Home › Forums › Guriddo jqGrid JS › Help › Dynamically Populate Select Dropdown
In advance, I would like to thank you for your awesome plug-in.
Hello Nikk,
Yes, this is discussed many times and it seems that I should do a example for this.
I have edit this post finding a better solution – I will post it tomorrow.
Best Regards
Tony
Tony,
Thank you very much.
Hello,
As promised. This example works ok on my demo
Thank you very much Tony, you're a life saver!
Hello Tony,
I tried to work with the example you gave above. withl slight variatiion and does not work right
Here is the js
The js
the target select list has something like
0:SELECT ZERO;1:SELECT ONE
$(”#targetsel”).html(targetSelect(thisval))this does not work becasue it needs html.
how do i populate key:value pairs on the dorpdown.
– Thanks Shah
Hello,
On your
|
1 |
|
1 |
<span class="meta meta_function meta_function_js"><span class="entity entity_name entity_name_function entity_name_function_js">targetSelect construct a ...</select. element using the information from the response.<br />Best Regards<br />Tony</span></span> |
thanks that worked!
Tony,
Thanks for your support, but I can't seem to get this to work.
ive been doing it like this with php, works good..
{name:'freqname', index:'freqname', width : 35, editable: true,edittype:”select”,editoptions:{value:””}},
Hi Tony
I have followed your example as per your post on 19/12/2009 (17:04hrs).
I have put in the code as you suggested for inline editing & it works ok. However, when adding a new record & I select the first dropdown, the 2nd dropdown doesnt load. It must be because I am specifying the wrong element to be updated(because my column definition is specific for inline editing as as use the rowId)
What can I do so that in my col definition that it will work for both Form Editing(when adding a record) & inline Editing(when editing a record) ?
Also one other thing, when I put in this code as you suggested
$(rowid_select_two).html(res);
my 2nd column did not update(I got no error in firebug).
So what i did to make this work, I did this:
My code looks identical to yours and it still isn't picking up the events.
Hi everybody,
as all of you guys, I need a dropdown2 (subcategories) populated when another dropdown1 (categories) is changed.
I have an inline grid.
If I use the approaches explained in this forum (dataUrl and Ajax calls) everything works fine but what I want now is to
avoid all those Ajax requests to increase my site performance.
My idea is to load every option in the first load of the page so I have created a JQuery function (populateFromLocalValues)
to change the dropdown2 values working with them locally.
When I change a value in dropdown1 the values are correctly populated in dropdown2 throughtthe implementation of a
change function in the “change dataEvent” of the dropdown1.
My problem comes when I have to initialize the values of dropdown2 when I select a row. I'm using the following code:
{name:'subcategory_id',index:'subcategory_id', width:110, align:”right”, sortable:false, editable: true, edittype:”select”,
When adding its no problem as its a new record you are creating.
The problem with select boxes that link to each other is in inline editing.
Using inline edit the rows all contain their correct data before you select a row. The when selecting a row all the select urls are fired.
What is the best approach? I currently have a situation where I have 5 columns each with a select list. The first select, causes the 2nd one to fire. As the second one fires, it should cause the 3rd. and so on. They selects are all related to each other and the selected values are passed from one select to another to retrieve appropriate data.
Any help on this issue is really appreciated as I am stuck.
Thanks
Dear all,
I tried to implement dynamic select dropdown on toolbar searching, but I cann`t populate subcategory dropdown.
Can you show me where is something wrong?
here is my code:
{name:'Country'
Hello Candra,
It seems to me that your code have at least the error inside of $.get success handler. You should use $(“select#gs_City”).html(res) instead of
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top