jQWidgets Forums
Forum Replies Created
-
Author
-
I figured it out. I have to put the clearfilters in the function
I don’t think there is anything wrong with the data-I can use this exact data in your tree widget and it works fine. It looks like the problem is still as I stated earlier although I didn’t notice at first because I have to scroll down and that is that it’s loading ALL records at the root level. So, of course, when you try to expand it doesn’t see the child record as unique since it is already loaded.
They are unique. SPCSpaceID is a primary key.
Thank you Peter, I moved the pageable to the tree grid and it is loading quickly but I’m still not seeing the expected behavior. It loads the root level and when I click on the expand arrow I get an error– “check whether you add records with unique id/key”. If I click on the next page arrow it shows all children for all elements of the root level. The behavior I’m looking for is when the expand is clicked at the root level it shows the children for only that root element which is the behavior I see on your grids but doesn’t seem to be working for me.
I provided my example above and pageable didn’t make any difference. My bigger problem is that it loads all records as root elements. So instead of loading only the root records (of which there are only 11) and then loading the next level on expanding that it loads all 7500 records on the current page as root records.
Could it be something with the structure of the data? As I stated before this same data structure worked with a regular tree widget it was just too slow because of the number of records.
Thanks Peter but pagaeable gained me nothing-the behavior is still the same. I want to use virtual mode because there are 7500 records total and I only want to load a subitem when the parent item is expanded. I tried with the code in both of the virtual mode demos and both load ALL of the records at the root level and lock up the page. Following is my code….
var source =
{
dataType: “json”,
dataFields: [
{ name: ‘SPCSpaceID’, type: ‘number’ },
{ name: ‘ParentSPCSpaceID’, type: ‘number’ },
{ name: ‘SpaceText’, type: ‘string’ },
],
heirarchy:
{
keyDataField: { name: ‘SPCSpaceID’ },
parentDataField: { name: ‘ParentSPCSpaceID’ }
},
id: ‘SPCSpaceID’,
pageable: true,
root: ‘value’,
url: ‘/project/Search/GetSpace’
};$(“#treeGrid”).jqxTreeGrid(
{
width: 200,
virtualModeCreateRecords: function (expandedRecord, done) {var dataAdapter = new $.jqx.dataAdapter(source,
{
formatData: function (data) {
if (expandedRecord == null) {
data.$filter = “(ParentSPCSpaceID eq null)”
}
else {
data.$filter = “(ParentSPCSpaceID eq ” + expandedRecord.SPCSpaceID + “)”
}
return data;
},
loadComplete: function()
{
done(dataAdapter.records);
},
loadError: function (xhr, status, error) {
done(false);}
});
dataAdapter.dataBind();
},
virtualModeRecordCreating: function (record) {
},
columns: [
{ text: ‘SpaceText’, dataField: ‘SpaceText’},
]
});
};I’m not sure how paging would help as the root level only has 11 items and the most any level would have would be about 20. Can anyone be of further assistance? As you can see in my posting I am using virtual mode but when I run this all of the records show at the top level even though they should be subitems as designated by their ParentSpaceID. The ParentSpaceId value for the top level is null in the db.
I am using virtual mode. The tree loads all of the data at the root level ignoring the hierarchy.
February 11, 2016 at 4:41 pm in reply to: Dynamic Hierarchal json data Dynamic Hierarchal json data #81382Thanks, for anyone who is wondering I changed the GetSpace method so it only returned those 3 specific fields not the whole model.
October 5, 2015 at 1:20 pm in reply to: Edit/Delete with image column using MVC Edit/Delete with image column using MVC #76438Sorry, I’ve been looking at too many samples, what I meant was I didn’t want a popup. I want to link to my MVC Controller/View.
October 2, 2015 at 8:08 pm in reply to: Edit/Delete with image column using MVC Edit/Delete with image column using MVC #76396Not really, I don’t want inline edit. When I do the edit I want to go to my edit action in my controller and display the edit view.
-
AuthorPosts