easyui datagrid url mvc 参数动态

来源:互联网 发布:软件windowsphone 编辑:程序博客网 时间:2024/05/16 16:02
页面代码
<table id="dgUser" title="用户列表" class="easyui-datagrid" style="width:700px;height:250px"                                                                    url=@Url.Content("~/UserManage/GetList")             data-options="rownumbers:true,singleSelect:true,autoRowHeight:false,pagination:true,                fit:true,                toolbar:'#toolbar',pageSize:10,                fitColumns:true">                                                                                     <thead>                                                                                                                                              <tr>                                                                                                                                                 <th field="UserId" width="50">用户id</th>                                                                                                 <th field="UserName" width="50">用户名称</th>                                                                                                   <th field="Sex" width="50" data-options="formatter:sexFormatter">性别</th>                         <th field="BirthDay" width="50">生日</th>                                                                  <th field="Address" width="50">住址</th>                                                                                                      </tr>                                                                                                                                        </thead>                                                                                                                                     </table>                                         



加上 js即可

查询时的方法

function reload() {
    $('#dgUser').datagrid({
        url: rootUrl + "UserManage/GetList?username='4'"
    });
}


参考:http://blog.csdn.net/zwk626542417/article/details/18839909

0 0
原创粉丝点击