xx.php输出html?输出这个干吗,又不是datagrid需要的数据。如果你要修改条件,可以用load方法,新增加你的参数就行了Load and show the first page rows. If the 'param' is specified, it will replace with the queryParams property. Usually do a query by passing some parameters, this method can be called to load new data from server.$('#dg').datagrid('load',{ code: '01', name: 'name01' });
index: 2,
row: {
name: 'new name',
note: 'new note message'
}
});其row的数据由ajax请求得到 再使用该方法去局部更新,其他详情自己看官方doc
echo json_encode($result);
<table id="best_list" class="easyui-datagrid" style="width:720px;height:auto" title="Best_list"
data-options=" url: ‘xx.php’, singleSelect: true, rownumbers:true "
>
现在我用个方法输出同样的json结果,该怎么用这个方法替换掉以前url中的.php文件?
<?php
include_once 'get_bestlist.php';
$getbest = new getBestList();
?>
<table id="best_list" class="easyui-datagrid" style="width:720px;height:auto" title="Best_list"
data-options=" url: <?php $getbest->initBestList() //这个方法将输出个json对象?>, singleSelect: true, rownumbers:true "
>
code: '01',
name: 'name01'
});
<table id="best_list" class="easyui-datagrid" style="width:720px;height:auto" title="Best_list"
data-options=" pagination:true, url: 'get_GlobalNetwork.php', singleSelect: true, rownumbers:true "
>
<thead>
<tr>
因为页面有很多datagrid如果每一个datagrid都要一个.php为它初始化提供数据源就显得很臃肿。 所以我想用个输出json格式数据的方法来代替。怎么写这个url?
---------------------------------当查询条件改变后,点击‘go’按钮,怎么用根据新的条件用ajax刷新下面对应的datagrid里的数据?
希望能用个小小demo说明下
region: $('#region').val(),
brand: $('#brand').val(),
date: $('#date').val()
});