开发者

Hiding/Showing form field via dataEvents

开发者 https://www.devze.com 2022-12-20 18:23 出处:网络
I want to hide/show the form field base on selection from select form field, I used the following code but it didn\'t hide the #Job开发者_如何学编程_Name. How to acheive this?

I want to hide/show the form field base on selection from select form field, I used the following code but it didn't hide the #Job开发者_如何学编程_Name. How to acheive this?

{  name:   'Job_Number',
    index: '`Job #`',
    editable: true,
    edittype: 'text',
    editoptions: { size: 10, readonly: 'readonly'},
    editrules: {required: true },
    formoptions: { label: 'Job #' },
    width: 10,
    formatter: 'integer',
    formatoptions: { thousandsSeparator: '' },
    searchoptions: { sopt: ['eq','ne','lt','le','gt','ge', 'in', 'ni'] },
    align: 'right',
    sortable: true
 },
 {  name:   'Job_Name',
    index: '`Job Name`',
    editable: true,
    edittype: 'select',
    editoptions: { //size: 1,
                value:{1:'One',2:'Two'},
                  // dataUrl: 'select',
                   dataEvents: [
                      {  type: 'change',
                         fn: function(formid) {
                               $("tr_#Job_Number").hide();
                         }
                      }
                   ]
   },
    formoptions: { label: 'Job Name' },
    searchoptions: { sopt: ['eq','ne','lt','le','gt','ge', 'cn', 'nc', 'bw', 'bn'] },
    align: 'right',
    width: 150,
    align: 'left',
    sortable: true
 }

Thanks in advance,

lupind


Does the event fire at all? Use alert('') to check.

Why do you use tr_#Job_Number - with underscore? Shouldn't it be tr#Job_Number or even just #Job_Number, or better $(formid).find("#Job_Number")?

0

精彩评论

暂无评论...
验证码 换一张
取 消