jQWidgets Forums
Forum Replies Created
Viewing 5 posts - 1 through 5 (of 5 total)
-
Author
-
February 5, 2015 at 7:14 am in reply to: How to get parent ID? What is the correct approach? How to get parent ID? What is the correct approach? #66568
Found it!
function getParentID(id){ var htmlElement = $('#'+id.toString())[0]; var item = $('#jqxWidget').jqxTree('getItem', htmlElement); var parentId = item.parentId; return parentId; }
February 5, 2015 at 5:20 am in reply to: How to get parent ID? What is the correct approach? How to get parent ID? What is the correct approach? #66554function createTree($ID) { if ($ID == undefined){ $ID = 0; } $.ajax({ url: 'json_directories.php', success: function (data) { var source = {datatype: 'json', datafields: [{name: 'dir_id' },{name: 'parent_id' },{name: 'name'}], id: 'dir_id', localdata: data }; var dataAdapter = new $.jqx.dataAdapter(source); dataAdapter.dataBind(); var records = dataAdapter.getRecordsHierarchy('dir_id', 'parent_id', 'items', [{ name: 'name', map: 'label'},{name: 'dir_id', map: 'id'}]); $('#jqxWidget').jqxTree({ source: records, width: '190px'}); $('#jqxWidget').jqxTree('selectItem',$('#'+$ID)[0]); $('#jqxTree').jqxTree({ source: records, width: '190px'}); $("#jqxTree").jqxTree({ width: 300, height: 220}); $('#jqxTree').jqxTree('selectItem',$('#0')[0]); }, error: function () { alert('The source is unavailable!'); }//success });//ajax }
I figured it out. Misspelled!
The problem is somewhere in the setting of the parameters for the DataTable
I am trying to achieve a three panel vertical layout where the first panel can only expand to a certain width and the third panel is static
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)