Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
inlinenav dynamic drop down
05/11/2014
02:10
Avatar
upperdeck
Member
Members
Forum Posts: 8
Member Since:
05/11/2014
sp_UserOfflineSmall Offline

I have been looking all over for a solution to this. I see dozens of people asking how but have yet to find an answer?

using the daturl/json methods how do you dynamically generate the dropdown select box?

so say for example a person can add a record for any given month.  the drop down would have 1-12 in it.   then after they add the first month the next row add would have 2-12 in it and so on. my call to the database works find if i hardcode a person id, but I want to make the personid dynamic based on something that happens elsewhere in the page. How do i make this happen?

 

as i said I see this asked over and over, but have yet to find a workable solution?  being new to jqgrid maybe I just dont understand the tool well enough?

06/11/2014
03:55
Avatar
upperdeck
Member
Members
Forum Posts: 8
Member Since:
05/11/2014
sp_UserOfflineSmall Offline

do i take the lack of replies to mean its a dumb question or noone knows how to do it?  it seems like a basic feature that many have been looking for answer too.

09/11/2014
12:05
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

upperdeck said
do i take the lack of replies to mean its a dumb question or noone knows how to do it?  it seems like a basic feature that many have been looking for answer too.

Hello,

If you do not know this is a Open Source project and we do not have agreements to answer quick.

This will be changed soon.

 

Now to the question - If I understand right you will to cut the selects for one field based on the selection of the previous one.

This can not be done automatically using dataUrl.

I recommend you to obtain first all the selects in all fields and the use JavaScript to decrease the elements on it based on the selection - if I understand right.

For this purpose you can bind a change event of the select. To do this I recommend you to use dataInit on which you can bind the event.

 

Another possible solution is to call your own ajax after the change of the field and fill the next field with the needed data from the server.

 

Kind Regards

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

12/11/2014
03:05
Avatar
upperdeck
Member
Members
Forum Posts: 8
Member Since:
05/11/2014
sp_UserOfflineSmall Offline

I appreciate any help. I was more wondering if i was chasing a rainbow or if i had a realistic goal.  i have only been coding for a few days in this tool so didnt want to be bogged down with something i could never get working

I have a grid with players in it.  the players have a record for every week they play.  the week drop down is created by a separate process.  so after week one the drop down has a 1 in it.  after week 2 the drop down has 1,2 and so on.  the stats dont get updated every week so sometimes i will go in later say week 3 and the dropdown says 1,2,3.  So i choose week 1 and add a record.  Now I want to add a new row and the drop down should only allow 2,3 to be selected.    this changes for every player.   The grid knows which player is being modified so the drop down would need to pass that to the ajax that builds the select.  in the sql call it looks to see if a week already has a record and knows not to send it back.

 

so in essence the select is not built on something that happens to a field in a row but by what ID was used to build the grid. 

I think i understand it could be done if the select was built every time a add event fired, just trying to find an example of how to do that..

thanks

17/11/2014
21:43
Avatar
upperdeck
Member
Members
Forum Posts: 8
Member Since:
05/11/2014
sp_UserOfflineSmall Offline

I got this working by  setting the colprop within the loadcomplete funtion call.  I set the editoptions:dataurl for that column and pass in the extr parms i needed to make the dynamic select statement work.

19/11/2014
15:31
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Thanks for sharing.

 

Kind Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 496

Currently Online:
25 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information