I am using a select list in my header filter but after filling the data when the page is loaded the select list is blank by default. If I click on the list I see all the values. How can I have the first value show in the dropdown when the page is load? (Note: ChangeTypes is a JS array filled earlier in the code)
var ChangeTypes = [],
Priorities = [],
ImpactTypes = [],
Users = [];
@foreach (var Type in Model.ChangeTypes)
{
@:ChangeTypes.push("@Type");
}
@foreach (var Type in Model.ImpactTypes)
{
@:ImpactTypes.push("@Type");
}
@foreach (var Priority in Model.Priorities)
{
@:Priorities.push("@Priority");
}
@foreach (var User in Model.Users)
{
@:Users.push("@User");
}
var colModel = [
{ title: "Project ID", dataType: "integer", dataIndx: "ID", hidden: true },
{ title: "Project Name", dataType: "string", dataIndx: "Name", resizable: true, width: 250, halign: "center", filter: { type: 'textbox', condition: 'contain', listeners: ['keyup'] }},
{ title: "Notes", dataType: "string", resizable: false, width: 75, halign: "center" },
{ title: "Change Type", dataType: "string", dataIndx: "Type", resizable: true, width: 169, halign: "center", filter: { type: 'select', options: [ChangeTypes], condition: 'equal', value: 'IN', prepend: { '': '--Select Type--' }, listeners: ['change']}},
{ title: "Priority", dataType: "string", dataIndx: "Priority", resizable: true, width: 55, halign: "center" },
{ title: "Impact", dataType: "string", dataIndx: "Impact", resizable: true, width: 55, halign: "center" },
{ title: "Assigned To", dataType: "string", dataIndx: "AssignedTo", resizable: true, width: 150, halign: "center" },
{ title: "Estimated Start Date", dataType: "date", dataIndx: "EstimatedStartDate", resizable: true, width: 145, halign: "center" },
{ title: "Estimated Completion Date", dataType: "date", dataIndx: "EstimatedEndDate", resizable: true, width: 165, halign: "center" },
{ title: "Date Actually Started", dateType: "date", dataIndx: "DateStarted", resizable: true, width: 145, halign: "center" },
{ title: "Date Actually Compleated", dataType: "date", dataIndx: "DateCompleated", resizable: true, width: 165, halign: "center" },
{ title: "Reason For Change", dataType: "string", dataIndx: "Reason", resizable: true, halign: "center", width: 283, filter: { type: 'textbox', condition: 'contain', listeners: ['keyup'] }},
{ title: "Approval Status", dataType: "string", dataIndx: "ApprovalStatus", resizable: true, width: 105, halign: "center" },
{ title: "Approved By", dataType: "string", dataIndx: "ApprovedBy", resizable: true, width: 135, halign: "center" }
];