raymond
raymond

Reputation: 17

change the url of easyui datagrid on button click

i'm using easyui datagrid

i added a new button which would populate the datagrid with another set of data based on what row you selected.

here is the button:

a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="view-breakdown()">View Breakdown</a>    

and this is my table:

<table id="dg" title="My Users" class="easyui-datagrid" style="width:980px;height:370px;"
        url="get_users.php"
        toolbar="#toolbar" pagination="true"
        rownumbers="true" fitColumns="true" singleSelect="true" height="auto";>
    <thead>
        <tr>
        <th field="item_group_desc" width="50">item description</th>
        </tr>
    </thead>
</table>

i want the function view_breakdown() to get the value of item_group_desc and change the url of the table to "breakdown.php" how can i do this? thanks in advance

Upvotes: 1

Views: 7596

Answers (1)

Saigitha Vijay
Saigitha Vijay

Reputation: 466

try like this,

view_breakdown()
{
   $('#dg').datagrid({
      url:'breakdown.php'});
 }  

Upvotes: 0

Related Questions