This is a migrated thread and some comments may be shown as answers.

[Solved] Populate grid after combobox selection change event

2 Answers 97 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Subhash Chandra
Top achievements
Rank 1
Subhash Chandra asked on 20 Feb 2012, 11:47 PM
Hi,
     I have a combobox which is filled with category names.
Now I have to populate a grid which will hold the product names for each category selected in combobox.

In combobox onchanged event, I have written $.get("Action method"+categoryID,"","") and decorating action method with [HttpGet] attribute but it is not working.

Please share some ideas to solve this problem.


Thanks,
Subhash

2 Answers, 1 is accepted

Sort by
0
Accepted
Jared
Top achievements
Rank 1
answered on 21 Feb 2012, 02:44 AM
Maybe do something like this? (Sorry if there are errors, I just typed it out real quick, but you should get the idea)

For your Combobox:
Combobox_OnChange: function (e) {
        $("#GridId").data("tGrid").rebind();
    }

Now for the Grid:
Grid_onDataBinding: function (e) {
        e.data = $.extend(e.data, {
            categoryId: $("#ComboboxId").data("tComboBox").value()
        });
 }
0
Subhash Chandra
Top achievements
Rank 1
answered on 21 Feb 2012, 05:48 AM
Hi Jared,
                Thank you very much.Your suggestion helped me and my problem has solved..
I just called 
function Grid_OndataBinding(e)
{
   var suppId=$("#SupplierComboBox").data("tComboBox").value()
        
 e.data = {supplierID:suppId};
 
}
Where supplierId is a parameter in action method.
function OnSupplierChange(e)
{
 $("#DisplayProducts").data("tGrid").rebind();
}
Tags
Grid
Asked by
Subhash Chandra
Top achievements
Rank 1
Answers by
Jared
Top achievements
Rank 1
Subhash Chandra
Top achievements
Rank 1
Share this question
or