Title: treegrid return row index proplem Post by: mars610 on November 03, 2011, 03:25:28 AM How to get in line treegrid index, in the API treegrid dependent datagrid, the datagrid has getRowIndex way to get row index. but, in treegrid always used to return -1.
code: if use datagrid , the code like this: var node = $("#tt").datagrid("getSelected"); var nodeIndex = $("#tt").datagrid("getRowIndex",node); the nodeIndex value is right! but use treegrid: var node = $("#tt").treegrid("getSelected"); var nodeIndex = $("#tt").treegrid("getRowIndex",node); the nodeIndex value is always -1 Thanks for help Title: Re: treegrid return row index proplem Post by: ClSoft on February 15, 2013, 03:28:09 PM Hi all
I have same problem - I always have -1 in alert: var current_row = $('#members_tree').treegrid('getSelected'); var current_index = $('#members_tree').treegrid('getRowIndex',current_row); alert(current_index); how to get selected index? Thanks. Title: Re: treegrid return row index proplem Post by: Punkerr on February 15, 2013, 03:54:06 PM Because treegrid don't have getRowIndex method.
Title: Re: treegrid return row index proplem Post by: ClSoft on February 16, 2013, 12:11:20 AM OK I can add my ID column (from 1 to N) and read that ;D
Title: Re: treegrid return row index proplem Post by: ClSoft on February 24, 2013, 12:42:48 PM Hi all
why this code does not work: $('#mt').treegrid('select',5); with other words, how to select specified row? I have added numbers from 1 to N in the treegrid and I know what row I need to select, but above code does not work. Thanks. Title: Re: treegrid return row index proplem Post by: ClSoft on February 26, 2013, 02:05:46 AM anybody?
Title: Re: treegrid return row index proplem Post by: ClSoft on March 05, 2013, 10:35:27 PM Hi all why this code does not work: $('#mt').treegrid('select',5); with other words, how to select specified row? Thanks. stworthy, please? Title: Re: treegrid return row index proplem Post by: stworthy on March 05, 2013, 11:23:30 PM When calling 'select' to select a row, the row id value must be passed. Look at the statement.
$('#mt').treegrid('select',5); The 5 must be the id value of the row to be selected. Please refer to this sample http://jsfiddle.net/fgtDw/. Title: Re: treegrid return row index proplem Post by: ClSoft on March 06, 2013, 12:38:46 AM Thank you, but it does not work.
I try first on that way - on TreeGrid click I remember clicked ID (number) and after edit is finished (on onClose event I call this: $('#members_tree').treegrid('select',current_row); alert(current_row); give me right number. Here is treegrid declaration: Code: <table id="members_tree" class="easyui-treegrid" toolbar="#tb" fit="true" fitcolumns="true" rownumbers="true" url="json/members_tree.json" idField="id" treeField="firstlastname" attached is FireBug error and my treeGrid what I'm doing wrong? Title: Re: treegrid return row index proplem Post by: ClSoft on March 06, 2013, 12:54:24 AM OK this row make problem:
$('#members_tree').treegrid('reload'); // reload the user data after them I call this: $('#members_tree').treegrid('select',current_row); now I moved selecting on onLoadSuccess event and it works fine! Thanks! |