Forum
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):
//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):
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:
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?
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66