JQGrid值和文本列 [英] JQGrid Value and Text Column
本文介绍了JQGrid值和文本列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一列想要在阅读/显示模式下显示为文本(例如CityName).当用户单击编辑"时,我希望将其显示为选择",然后我将传递城市ID",以便可以显示带有options == CityID的选择"控件.
I have a column that I want to display as a Text(e.g CityName) on read/display mode. When the user clicks edit, I want it to be displayed as a Select, i would then pass the CityID so that I can display the Select Control with options==CityID as selected.
jqGrid是否具有开箱即用的功能,还是我必须实现自定义格式化程序?
Does jqGrid have this functionality out of the box or do I have to implement a custom formatter?
谢谢
推荐答案
已经了解了
这是我的解决方法
col模型
{ name: 'CityID', index: 'CityID', width: 55, editable: true, edittype: 'select', editoptions: { dataUrl: 'City/GenerateCityOptions' }, formatter: CityFormatter},
function CityFormatter(cellvalue, options, rowObject) {
return rowObject.CityName; //The field name that i wanted to be displayed instead of id
}
这篇关于JQGrid值和文本列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文