2013-02-20 58 views
1

你好,我想請教一下負載方法easyui的TreeGrid

我從這個URL http://jeasyui.com/documentation/treegrid.php

我沒有發現的TreeGrid load方法讀取easyui的TreeGrid文檔,但因爲我知道,從數據網格的TreeGrid依賴,所以我去這個網址http://jeasyui.com/documentation/datagrid.php

在easyui DataGrid中,負載方法的代碼格式,像這樣
$('#dg').datagrid('load',{code: '01',name: 'name01'});
讓我解釋一點關於上面的代碼,上面有一些條件負載DataGrid中的代碼,代碼= '01'和name ='name01',來自datagrid URL。代碼和名稱視爲HTTP_POST_VAR DataGrid中的URL PHP文件,進一步利用了SQL條件值

但是,當我嘗試實施的DataGrid load方法在我的TreeGrid,看起來像這樣下面的代碼
$('#dg').treegrid('load',{code: '01',name: 'name01'});
它不能發送HTTP_POST_VAR

這是真的,那個easyui treegrid沒有像datagrid那樣的加載方法嗎?有沒有其他解決方案來加載easyui treegrid的某些條件?easyui的TreeGrid「負載」方法

回答

1

可以使用 'loadData' 動態加載的TreeGrid數據等下面,

$.ajax({ 
    type: "POST", 
    async : false, 
    url:'someURL.action?code=01&name=name01',  
    success: function(obj) { 
     $('#treegridId').treegrid('loadData', obj); 
    } 
}); 

或簡單地通過

$('#treegridId').treegrid({ 
    url:'someURL.action?code=01&name=name01'});