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
Edittype Select Multiple Issue
13/11/2013
20:49
Avatar
skunkman
New Member
Members
Forum Posts: 2
Member Since:
13/11/2013
sp_UserOfflineSmall Offline

When creating a table and setting one of the columns as:

edittype:"select", editoptions:{multiple: true, dataUrl: "somelocation"}

The first <option> tag for the multiselect drop down that is created is not selecting when set to select by default.

Viewing the code returned by the AJAX call, the "selected" attribute is present.  When the code is copied to an HTML page by itself, it is selected properly.  An example of this returned HTML from the AJAX call is this:

<select id="devices" multiple><option selected value="26">data</option><option selected value="23">network</option><option selected value="32">template</option></select>

In the jqGrid, the above when returned does not have the first option showing as selected, but the other two are.  When adding a blank <option> tag before the first one, it then selects the blank one AND the first one.

Please let me know if any more information is needed.

Thanks.

14/11/2013
09:15
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

As far as I remember the selected values are based on grid data and not on selected data that comes from the dataUrl.

It seems that the cell data (the field with multiselect) in the grid is not consistent with the data from the dataUrl.

Please check if the items in the grid cell are the same as in the dataUrl.

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.

14/11/2013
17:06
Avatar
skunkman
New Member
Members
Forum Posts: 2
Member Since:
13/11/2013
sp_UserOfflineSmall Offline

I was able to figure out what was causing this to happen.  There is a section of the main source JS file that has this:

// fix IE8/IE7 problem with selecting of the first item on multiple=true
if (i === 0 && elem.multiple) { this.selected = false; }

It was causing the first element to not be selected when it needed to be.  This issue can be closed.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
24 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