I am trying to avoid having to write custom code for each occurrence of a datagrid, and instead create a generic datagrid with filter criteria in the toolbar defined as either a text box or a combo box.
<table data-options="">
<div class="dgtoolbar">
<label>Year:</label><input name="year">
<label>Type:</label><input name="type" classname="easyui-combobox" data-options="data:[{txt:xxx,val:yyy},{txt:aaa,val:bbb}]">
</div>
</table>
So whenever the user selects a combo item, or changes the text in one of the fields contained within the datagrid's toolbar, I need to update the parameters of the dataagrid with thee values and reload it.
But I don't want to have to create individual functions for each occurrence of a datagrid and associated filter, as it is basically repeating the same code over and over again, the only things that change are the filter input names and the datagrid object.
How can I achieve this ??