javascript - easyui populate datagrid data based on combobox value -
i'm using http://www.jeasyui.com.
i need populate datagrid based on values combobox.
i populate combobox with,
<input id="listcombo"class="easyui-combobox" name="lo_client_id" data-options="url:'get_lists.php',valuefield:'id',textfield:'listname',panelheight:'auto'">
and working fine. datagrid looks like,
<table id="dg" title="my numbers" class="easyui-datagrid" style="width:500px;height:250px" url="get_users.php toolbar="#toolbar" pagination="true" rownumbers="true" fitcolumns="true" singleselect="true"> <thead> <tr> <th field="number" width="50">numbers</th> </tr> </thead> </table>
when give url = "get_users.php?id=1 gives me required results, id should dynamic according combobox. how can ?
you can use onselect
event of combobox , selected value , pass url
html
<input id="listcombo" name="listcombo"> $('#listcombo').combobox({ url:'get_lists.php', valuefield:'id', textfield:'listname', panelheight:'auto', onselect:function(record){ $('#dg').datagrid({ url:"get_users.php?id="+record.id }); } });
Comments
Post a Comment