在添加/编辑窗口中选择JQGrid / Date

编程入门 行业动态 更新时间:2024-10-27 17:22:59
本文介绍了在添加/编辑窗口中选择JQGrid / Date的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在编辑内联时可以将日期选择器工作到JQGrid,但是我无法在添加/编辑窗口中使用它。有没有人有关于如何做这个的例子或一个我可以看看的例子?

从该网站的demo我试图做什么: www.the-di-lab/demo/apples

我看到我可以使用以下方法,但不知道如何整合它:

dataInit:function(elem){ $(elem).datepicker(); }

解决方案

看起来他们正在使用'afterShowForm'将日期/颜色选择器附加到div。 (查看源代码)

jQuery(#list)。navGrid(#pager ,{edit:true,add:true,del:true}, {width:400,height:400,closeAfterEdit:true, afterShowForm:function(){$(#jsrs 。$($ / $ / $)$, onclickSubmit:function(){$(#jsrs)。 pre>

(查看源代码)

http://www.the-对于colorPicker $('#color'),可以使用ColorBicker({ onSubmit:function(hsb,hex ,rgb){ $('#color')。val(#+ hex); }, onBeforeShow:function(){ $(this) ColorPickerSetColor(this.value); } })bind('keyup',function(){ $(this).ColorPickerSetColor(this.value); } ); // Js for datePicker $('#date')。DatePicker({格式:'Ym-d',日期:$('#date')。val(), current:$('#date')。val ) start:1, position:'bottom', onBeforeShow:function(){ $('#date')。DatePickerSetDate($('#date' ).val(),true); }, onChange:function(formated,dates){ $('#date')。val(formated); } });

感谢您找到这个例子,我也在寻找如何做到这一点。

I have been able to work the Date Picker into JQGrid when editing inline, but I am unable to use it inside the add/edit window. Does anyone have instructions on how to do this or an example I can look at?

demo from that site of what I am trying to do: www.the-di-lab/demo/apples

I read that I could use the following method but not sure how to integrate it:

dataInit : function (elem) { $(elem).datepicker(); }

解决方案

It looks like they are using 'afterShowForm' to attach a date/color picker to a div. (view source)

jQuery("#list").navGrid("#pager",{edit:true,add:true,del:true}, {width:400,height:400,closeAfterEdit:true, afterShowForm:function(){ $("#jsrs").load("/demo/apples/jsrs"); }, onclickSubmit:function() { $("#jsrs").empty(); } },

(view source)

www.the-di-lab/demo/apples/jsrs //Js for colorPicker $('#color').ColorPicker({ onSubmit: function(hsb, hex, rgb) { $('#color').val("#"+hex); }, onBeforeShow: function () { $(this).ColorPickerSetColor(this.value); } }).bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); }); //Js for datePicker $('#date').DatePicker({ format:'Y-m-d', date: $('#date').val(), current: $('#date').val(), starts: 1, position: 'bottom', onBeforeShow: function(){ $('#date').DatePickerSetDate($('#date').val(), true); }, onChange: function(formated, dates){ $('#date').val(formated); } });

Thanks for finding this example, I was looking for how to do this as well.

更多推荐

在添加/编辑窗口中选择JQGrid / Date

本文发布于:2023-10-31 01:59:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1544655.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:编辑   窗口中   Date   JQGrid

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!