开发者

jqGrid stype select empty on search dialog

I'm using version 4.1.1 and I'm configuring a column to be filtered using a . The part that matters looks like this

..., stype: 'select', searchoptions: { sopt: ['eq'], dataUrl: 'myUrl', buildSelect: myFunctionName }

Everything works great on the grid but not on the advanced search dialog. There the appears empty, without any options to cho开发者_运维问答ose from.

Any ideas why this is happening?

Thanks! Alex


Ok, this one was tricky...

Apparently jqGrid executes the request differently when populating the comboboxes on the grid header and on the search dialog.

I'm pulling the data from a ASP.net ASHX and when the request is made from the grid the result is the http response object. On the other hand, when the request is made from the dialog the result is the (expected) json string.

To solve this quickly I used this:

var list = typeof data === "string" ? eval(data) : eval(data.responseText);

So, if the result is a string I parse it directly to json, if it's an object I have to go deeper to get my json from the responseText.

I don't like it... but works :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜