JqG​​rid 不显示下拉框

发布于 2024-12-03 02:52:03 字数 619 浏览 1 评论 0原文

我的 jqgrid 有问题。我创建了一个从数据库调用值的下拉框,因此我在 colmod 中使用以下语法。

{name:'brate_id',index:'brate_id',width:100,formatter:"select",edittype:"select",editoptions:value:} ,可编辑:true},

我的brate_list是

$brate_list = $employee->get_table_for_dropdown('hr_basic_rate','brate_id','rate_hcode');

看来,当我放置格式化程序时,它不会显示下拉框,除非我单击单元格来选择它。但是当我删除格式化程序时,它会显示下拉框,但是当我保存数据时,它会发送错误的数据类型

(例如,当我从数据库传递值时,我将 Y 转换为“是”,所以当它出现在下拉框中时,它是“是”,因此,当我尝试在格式化程序打开的情况下保存数据时,它会发送 Y。但如果格式化程序被删除,它会将 Yes 发送到数据库,在数据库中它会变为 null)。

有没有办法在jqgrid中显示下拉框而不影响其保存和格式?

I have a problem with my jqgrid. I have created a dropdown box that calls values from the database, so I use the following syntax in my colmod.

{name:'brate_id',index:'brate_id',width:100,formatter:"select",edittype:"select",editoptions:value:<?=json_encode($brate_list)?>} ,editable: true},

my brate_list is

$brate_list = $employee->get_table_for_dropdown('hr_basic_rate','brate_id','rate_hcode');

It seems that when I place the formatter it does not show my dropdown box unless I click on the cell to select it. But when I remove my formatter it shows the dropdown box but when I am saving the data it sends the wrong datatype

(E.g. when I pass values from the database I convert Y to Yes, so when it appears in the dropdown box it is Yes, so when I try to save my data with the formatter on, it sends Y. But if the formatter is removed, it sends Yes to the database where it becomes null instead).

Is there a way to show the dropdown box in the jqgrid without affecting its saving and its format?.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烟雨扶苏 2024-12-10 02:52:03

我相信 editoptions:value: 之前应该有一个 { ,如下所示: editoptions: { value:

希望这有帮助!

{name:'brate_id',index:'brate_id',width:100,formatter:"select",edittype:"select",editoptions: { value:  <?=json_encode($brate_list)?>} ,editable: true},

I believe the editoptions:value: should have a { before like this: editoptions: { value:

Hope this helps!

{name:'brate_id',index:'brate_id',width:100,formatter:"select",edittype:"select",editoptions: { value:  <?=json_encode($brate_list)?>} ,editable: true},
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文