DoJo增强网格动态更新约束不起作用 [英] DoJo Enhanced grid updating constraints dynamically is not working

查看:79
本文介绍了DoJo增强网格动态更新约束不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个DoJo增强型数据网格,带有可编辑的数字文本框,并带有一些默认的min&最大限制.网格完全加载后,我需要更改约束.请提出同样的建议.下面是代码段,其中我将默认约束应用为最小值0和最大值100.

I have a DoJo enhanced data grid with editable number text box with some default min & max constraints. I need to change the constraints once grid loaded completely. Please advise on same. below is the code snippet, where i have applied default constraint as min 0 and max 100.

  1. 是否可以在定义布局时从dataStore字段设置最小约束值和最大约束值,即minAge和maxAge?
  2. 是否可以更新那些默认约束?

  1. Is it possible to set min and max constraints values from the dataStore fields i.e minAge and maxAge while defining the layout?
  2. If not is it possible to update those default constraints?

require(["dojox/grid/cells/dijit","dojox/grid/DataGrid"],function() {   
       window.masterlayout = [ [
        {'name' : 'Employee Name',styles:"word-wrap:break-word;", 'field' : 'msisdn',editable : false},
        {'name' : 'Min Age','field' : 'minAge' ,styles:"word-wrap:break-word;",editable : false},
        {'name' : 'Max age','field' : 'maxAge' ,styles:"word-wrap:break-word;",editable : false},
        {'name' : 'Age',
         'field' : 'age',
         'editable': true, 
          singleClickEdit :true,
         'alwaysEditing': false,
          styles:"word-wrap:break-word;",
          autoSave : false, 
          type:dojox.grid.cells._Widget, 
          widgetClass: dijit.form.NumberTextBox ,
          widgetProps: {required: true }, 
          constraint:{min:0,max:100,places:0} ,
          formatter : function(item, rowIndex, cell) { 
              var html = '<a href="javascript:ageLimitStatusGrid.edit.setEditCell(ageLimitStatusGrid.getCell(3),'+rowIndex+');">'+item+'</a>';
          return html; 
         }
       }
        ] ];
});

            var url = "Test URL";
            dataStore =new ServerSideStore({target:url});
            ageLimitStatusGrid = new EnhancedGrid({
                    store: dataStore,
                    structure: masterlayout,
                    selectionMode : 'none',
                    autoHeight : true,
                    //autoWidth : true,
                    autoRender : true,
                    queryOptions : {'deep' : true},
                    noDataMessage : '<span class="dojoxGridNoData">No Data found</span>',
                    loadingMessage : '<fmt_rt:message key="clls.loading.message"/>',
                    rowsPerPage: 5,
                    baseClass: 'balance_list',
                    plugins: {
                        pagination: { 
                            pageSizes: [],maxPageStep: 5,
                            description: true,
                            sizeSwitch: true,
                            position: "bottom"
                        }
                    }
            }, "ageLimitStatusGrid");
            ageLimitStatusGrid.startup();

推荐答案

您将需要使用grid.set('structure',layoutVariable)方法更新布局.

You will need to update your layout with the grid.set('structure', layoutVariable) method.

这篇关于DoJo增强网格动态更新约束不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆