change event of select tag in jQuery jqGrid

Hello Experts,

I want to know how to use change event of select (combobox) in jqGrid.
Can you help me about that?
boramaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
IrishPheremoneConnect With a Mentor Commented:
The GridID should be the ID of the Table... Now if you remove the GridID part - all select controls should have a change event ... if that is not the case - something else is wrong.

Do you have an example page / code ?


// Live event
$("select").live("change", function() {
alert(this.id);
});

Open in new window

0
 
IrishPheremoneCommented:
See code examples...
// After grid loads
$("select', "#" + GridID).change(function() {
alert(this.id);
});

// Live event
$("select', "#" + GridID).live("change", function() {
alert(this.id);
});

Open in new window

0
 
IrishPheremoneCommented:
Sorry - bug! There are two ways to do it... after the grid loads or using jQuery's new live() function.

See code examples
// After grid loads
$("select", "#" + GridID).change(function() {
alert(this.id);
});

// Live event
$("select", "#" + GridID).live("change", function() {
alert(this.id);
});

Open in new window

0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
boramaAuthor Commented:
Hello IrishPheremone,

I used your code but it seems no effect.

GridID is id of table or id of column with select tag or sth else?

Please tell me clearly about that
0
 
boramaAuthor Commented:
Hello IrishPheremone,

these are my example code:

jQuery("#table").jqGrid({
..............................
..............................
           colModel :[
                    {name:'test', index:'test', width:150, editable: true, edittype:"select", editoptions:{value:"1:1;2:2;3:3;4:4"}}, ]


I want to call one function when item of combobox "test" is changed. So I just want to know how to use change event in this combobox dynamically in IE browser.
0
 
boramaAuthor Commented:
Now I resolved it. But I have another thing, I have two select tag are category and subcategory combobox. When I choose one item in category combobox, all corresponding items  of subcategory combobox are also showed. But when I use setColProp of jqGrid, it has no effect when I choose one item in category combobox first but it has effect when choose secondly. Please help me about that
0
 
boramaAuthor Commented:
That's ok. now I got it
0
All Courses

From novice to tech pro — start learning today.