简体   繁体   English

从显示编辑后动态更改填充选择列表

[英]Dynamically Change Populate Select List after Edit From Displays

I am using jqGrid 4.15.6-pre我正在使用 jqGrid 4.15.6-pre

I have a Select list in my edit form that populates using dataURL in the onSelect function based on a couple of parameters.我的编辑表单中有一个选择列表,它根据几个参数在 onSelect 函数中使用 dataURL 填充。 There is a input element on the edit form that has a function bound to it that can change one of the parameter(customerReturnType) values.编辑表单上有一个输入元素,该元素绑定了一个可以更改参数(customerReturnType)值之一的函数。 I would like to programmatically repopulate the Select List based on the new parameter value.我想根据新的参数值以编程方式重新填充选择列表。

Here is my onSelect code:这是我的 onSelect 代码:

locationCheckOverride = false;
        customerReturnLocation = $("#customerReturnqueue").getRowData(id)['crrLocation'];
        customerReturnType = $("#customerReturnqueue").getRowData(id)['crrType'];
        editModeOverride = $("#customerReturnqueue").getRowData(id)['editModeOverride'];
        holdingLocationEditOnly = $("#customerReturnqueue").getRowData(id)['editHoldingLocationOnly'];
        
        $("#customerReturnqueue").setColProp('crrLocation', {
         editoptions: {
            dataUrl: '/QMSWebApp/CustomerReturnRecordsControllerServletV8?lifecycle=customerReturnLocationOptionsLessInitialized&currentLocation='+customerReturnLocation+'&crrType='+customerReturnType,
            selectFilled: function (options) {
                $(options.elem).select2({
                    dropdownCssClass: 'ui-widget ui-jqdialog zclassX2',
                    width: 300
                });
        }}});  

If I correctly understand the problem you want to dynamically change the select based on a change new value.如果我正确理解了您想要根据更改新值动态更改选择的问题。

Here is example in Guriddo jqGrid, but it should work in free-jqgrid. 这是 Guriddo jqGrid 中的示例,但它应该在 free-jqgrid 中工作。 This is just a idea how you can do this.这只是一个想法,你可以如何做到这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM