日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ExtJs6解决添加和修改Form共用一个form的隐藏域的id的取消传值

發(fā)布時(shí)間:2025/5/22 编程问答 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ExtJs6解决添加和修改Form共用一个form的隐藏域的id的取消传值 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

問題重現(xiàn):修改不會(huì)有問題,id會(huì)綁定之前的grid,有具體數(shù)字

添加有問題,因?yàn)閕d是空,傳的是綁定值的話會(huì)顯示“類名-1”,從int類型變成了string類型,后臺(tái)會(huì)出錯(cuò)

這是EduQuestionBankForm的代碼

/*** @author cjy* @Date 2018/6/2 15:06.*/ Ext.define('Admin.view.eduQuestionBank.EduQuestionBankForm', {extend: 'Ext.window.Window',xtype: 'eduQuestionBankForm',title: '題庫添加',requires: ['Admin.view.eduQuestionBank.EduQuestionBankFormController','Ext.form.Panel','Ext.form.field.ComboBox','Ext.form.field.Text','Ext.form.field.TextArea','Ext.layout.container.Fit'],layout: 'fit',modal: true,height: 440,width: 500,controller: 'eduQuestionBankForm',viewModel: {links: {theEduQuestionBank: {type: 'eduQuestionBank.EduQuestionBank',create: true}},data: {roleComboQueryMode: 'remote'}},items: {xtype: 'form',id:'dictionaryF',modelValidation: true,defaults: {labelAlign: 'left',margin: 10,msgTarget: 'side'},items: [{xtype:'hidden',name:'id',id :'hiddenEduQuestionBankId',bind:{value:'{theEduQuestionBank.id}'}},{xtype: 'textfield',name: 'title',allowBlank:false,fieldLabel: '題庫名稱',bind: {value: '{theEduQuestionBank.title}'}}, {xtype: 'textfield',name: 'postType',fieldLabel: '對(duì)應(yīng)崗位',allowBlank:false,bind: '{theEduQuestionBank.postType}'}, {xtype: 'textfield',name: 'createUserId',fieldLabel: '創(chuàng)建人',allowBlank:false,bind: '{theEduQuestionBank.createUserId}'}],buttons: [{text: '確定',handler: 'editEduQuestionBank'}, {text: '取消',handler: 'closeEduQuestionBankWindow'}]} });

解決方案:

正則判斷是否是數(shù)字,是數(shù)字則找到id或者name的地方,將其禁用,就不會(huì)再向后臺(tái)發(fā)送參數(shù)了

var reg = /^\d+$/;if (!reg.test(form.form.findField('hiddenEduQuestionBankId').getValue())) {form.form.findField('hiddenEduQuestionBankId').setDisabled(true);}

?

轉(zhuǎn)載于:https://www.cnblogs.com/Java-Starter/p/9133429.html

總結(jié)

以上是生活随笔為你收集整理的ExtJs6解决添加和修改Form共用一个form的隐藏域的id的取消传值的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。