EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: mazvv on April 14, 2013, 07:41:39 AM



Title: Treegrid and onBeforeLoad
Post by: mazvv on April 14, 2013, 07:41:39 AM
I have a problem with treegrid event onBeforeLoad:
Code:
	<table class="easyui-treegrid" border="false" fit="true"
checkOnSelect="false" selectOnCheck="false"
data-options="
onBeforeLoad:function(row, param){
// param.q = $(this).closest('.container').find('.toolbar .search-tool input.search').val();
param.rid = 1;
return true;
},
onDblClickRow:function(rowIndex, rowData){
$(this).closest('.container').attr('unselectable','on').css('UserSelect','none').css('MozUserSelect','none');
$(this).closest('.container').find('.toolbar a[href=\'${request.route_url('navigations.edit')}\']').click();
}"
url="${request.url}" singleSelect="true" rownumbers="true" idField="rid" treeField="name" toolbar=".toolbar:last">
    <thead> 
        <tr> 
        <th field="_rid" width="40" checkbox="true"
        data-options="formatter: function(value,row,index){return row.rid;}"></th>
        <th field="rid" width="60" sortable="true">ID</th>
        <th field="name" width="160" sortable="true">${_(u'name')}</th>
        </tr> 
    </thead>
</table>

I'm getting error: Uncaught TypeError: Cannot set property 'rid' of undefined
what i'm doing wrong?


Title: Re: Treegrid and onBeforeLoad
Post by: stworthy on April 14, 2013, 08:28:58 AM
Please try to use the code below:
Code:
onBeforeLoad:function(row, param){
if (!row){
param.rid = 1;
}
return true;
}