0
votes

With the jQuery EasyUI, we can create a grid table with the queryparams. here is the sample code

$('#dg').datagrid({
    queryParams: {
        name: 'easyui',
        subject: 'datagrid'
    }
});

However,what I am trying to achive is create queryparams inside the html tags like the belove code

    <table id="tt" class="easyui-datagrid"
      url="Service.asmx/GetReportByFilter"
       rownumbers="true" pagination="true" data-options="singleSelect:true,collapsible:true,
method:'post'"
   queryparams="{name: 'easyui',subject: 'datagrid'}">

                        </table>

It seeems that this part queryparams="{name: 'easyui',subject: 'datagrid'}" doent work.I mean no parameter to post the service called name and subject.It post only page and rows values

1
Just a guess. Try putting queryParams : { name: 'easyui', subject: 'datagrid'} as another key value pair inside of the data-options attribute - Richard Abercrombie
I will try ,lets seee - stackada
you should try something like data-options="singleSelect:true,collapsible:true, method:'post',queryParams:{name:'easyui', subject:'datagrid'}" - Hilarius L. Doren

1 Answers

0
votes

If you need to send some parameters to the url from the easyui grid, but not using the url, you can use the method=post and add the parameters in the queryParams, like this. Works for my!!

<table class="easyui-datagrid" style="width: 99%;;height:250px"
   url="views/action.php?table=employee&view=form&action=list-fields"
   toolbar="#toolbar" pagination="true"
   rownumbers="true" fitColumns="true" singleSelect="true" pagePosition="top"
   data-options="onSelect:row_select,onUnselect:row_unselect,onSortColumn:sort_column,method:'post',queryParams:{employee_id:'7'}">
<thead>
<tr>
    <th field="name" width="60" sortable='true'>Name</th>
    <th field="value_list" width="40" sortable='true'>Value List</th>
    <th field="value" width="40" sortable='true'>Value</th>
</tr>
</thead>