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
Show multiple selected options on Formedit mode
29/06/2009
11:31
Avatar
Renso
PA
Member
Members
Forum Posts: 118
Member Since:
11/09/2008
sp_UserOfflineSmall Offline

Not sure if I am doing something wrong but for the edittype:”select” col model property with editoptions:{multiple:true,size:4,value:allAccountRoles}, it does not select (highlight) the selected items in the listbox. It does show all the selectable options. No matter if I have one option or multiple options selected, it does not highlight them.

Here is my colModel {name:'AccountRole',    index:'AccountRole', width:40, editable:true, align:”left”, hidden:true, edittype:”select”, editoptions:{multiple:true,size:4,value:allAccountRoles}, editrules:{edithidden:true,required:true}},
During loadComplete I then load the actual data into var allAccountRoles and setColProp appropriately (see below):

loadComplete: function()    {
                //get all Account Roles
                allAccountRoles = $.ajax({url: $('#ajaxAllAccountRolesUrl').val(), async: false, success: function(data, result) {if (!result) alert('Failure to retrieve the Account Roles.');}}).responseText;
                $(item).setColProp('AccountRole',{editoptions:{multiple:true,size:4,value:allAccountRoles}});

I perform this in many grids with no issues and is my modus operandi for al my grids as I perform ajax calls for the list data when I need it. I can see my data being loaded via the ajax call but for some reason it does not highlight the selected options

Here is the result of the ajax call that fecthes the list of account roles:

1:Website Contact;2:Materials Contact;3:Lead Followup;4:Payment

Here is the HTML definition of the column in the formedit (modal dialog):

<select id=”AccountRole class=”FormElement multiple=”” name=”AccountRole size=”4>
<option value=”1>Website Contact</option>
<option value=”2>Materials Contact</option>
<option value=”3>Lead Followup</option>
<option value=”4>Payment</option>
</select>

I tried to set the col properties during both gridComplete and loadComplete, same result.
Not sure if it is not supported or a bug. I see in formedit.js, line 276:

case “select-multiple”:
postdata[this.name]= $(this).val();
var selectedText = [];
$(”option:selected”,this).each(
function(i,selected){
selectedText[i] = $(selected).text();
}
);
extpost[this.name]= selectedText.join(”,”);
break;
I notice that postdata[this.name] = $(this).val(), where the value of this.name = "AccountRole" and 

the result of this.val() is an array of 2,3 (second and third options selected) :

["2", "3" 0=2 1=3]

. This works fine once I am already in the modal dialog mode, but the values once I close the edit mode and select to edit the row again does not highlight my selected options.

Any ideas?

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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