Forum


09:29

Hello - I am trying (desparately) to fill my edit form dropdown from a db call (LINQ specifically). I can't seem to get the format it likes because my dropdown always comes up empty. I know I'm hitting my controller code because I'm setting a break point in it and hitting it. As a test I am bypassing the db call and just passing back a string I think should work but is not . Please any suggestions much appreciated. I could not find in the doc the format it is looking for. Here's my code:
Controller:
public string GetTypes()
{
string strRet = "";
return "1:Sideboom;2:Truck;3:Car";
}
aspx:
jQuery(document).ready(function() {
jQuery("#sandgrid").jqGrid({
url: '/EquipTrack/GridData/',
editurl: '/EquipTrack/Edit/',
datatype: 'json',
mtype: 'GET',
height: 255,
width: 755,
rowNum: 5000,
colNames: ['ID', 'Type', 'Make', 'Model', 'Year', 'Location', 'Insp Due', 'Serv Due', 'Miles/Hrs', 'Milage Dt', 'Reg By', 'Mngd By', 'Tag Exp',''],
colModel: [
{ name: 'equip_id', index: 'equip_id', width: 65, editable: true },
{name: 'type_desc', index: 'type_desc', width: 130, editable: true, edittype: "select", formatter: 'select', editoptions: { dataUrl: '/EquipTrack/GetTypes'} },
{ name: 'make_descr', index: 'make_descr', width: 80, editable: true },
.
.
.
}).navGrid('#sandgridp',
{}, //options
{reloadAfterSubmit:false}, // edit options
{reloadAfterSubmit:false}, // add options
{reloadAfterSubmit:false}, // del options
{} // search options
);
$('#sandgridp_center').remove();
$('#sandgridp_right').remove();
});
10:03

OK - I've got it populating the dropdown with the following format (found it on another topic):
return "<select><option value='1'>Sideboom</option><option value='2'>Truck</option><option value='3'>Car</option></select>";
I also removed the formatter: 'select' from my column definition because I was getting 'undefined' in my grid for every row in the equip_type column.
Now my issue is getting the dropdown to have the correct selection in it on edit. It comes up with the dropdown unselected. Any suggestions much appreciated.
Thanks.
Most Users Ever Online: 715
Currently Online:
42 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