Muhammad Adeel Zahid
Muhammad Adeel Zahid

Reputation: 17784

Static Dropdown in Jqgrid edit popup

I am using jqgrid for basic CRUD functionality on an asp.net mvc page. My requirement is that I want to show a dropdown on edit popup that will only contain static values e.g New and Existing. All the examples I find use editoptions with dataurl and buildselect method. Is there a way that I can build select list using static values when grid opens?

Thanks

Upvotes: 0

Views: 1225

Answers (1)

Oleg
Oleg

Reputation: 221997

It's very simple. You need just use value property of editoptions. Something like

{ name: "myColName", width: 100, editable: true, edittype: "select",
    editoptions: { value: "New:New;Existing:Existing", defaultValue: "New" }}

or if you use toolbar searching additionally then

{ name: "myColName", width: 100, editable: true, edittype: "select", stype: 'select',
    editoptions: { value: "New:New;Existing:Existing", defaultValue: "New" },
    searchoptions: { sopt: ['eq', 'ne'], value: ':Any;New:New;Existing:Existing' }}

Upvotes: 1

Related Questions