EasyUI Forum
September 16, 2025, 11:27:44 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Treegrid and onBeforeLoad  (Read 12096 times)
mazvv
Newbie
*
Posts: 20


View Profile WWW
« 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?
Logged

TravelCRM - opensource CRM for travel companies
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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;
}
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!