问题描述
我在管理器中制作了面板,它可以工作,这个项目
//////////
xtype: 'xcheckBox',id: 'view_index',name: 'view_index',/////////////
更准确地说,它运行良好,如果选中,则编号为 1,如果未选中,则插入基数为 0。在面板中一切正常。但是当我点击编辑时——tick 不在那里。我更改 xtype field: 'texfield' — 显示数字 1,这意味着它正确获取了信息。我在复选框上更改了 xtype - 勾号在那里,它有效。当我再次插入 xtype 时: 'xcheckBox' — 没有勾号。我疯了,我插入了所有我能做的: xtype: 'xcheckBox',
id: 'view_index',inputValue: '1',checked: true,
Tick 仍然不存在,即使在强制按下时检查:true。
checked: parseInt(config.record.view_index) || false,- not there
但是当我更改类型时一切正常,除了 0 不发送 我做错了什么?为什么 xcheckBox 理解为 1 或 0,但检查不起作用?
要调用编辑,我这样做
updateItem: function(btn,e) {
if (!this.updateTestwindow) {
this.updateTestwindow =
MODx.load({
xtype: 'test-window-updatetest',record: this.menu.record,baseParams: {
action: '/mgr/test/update',},listeners: {
success: {
fn: function () {
window.location.reload();
this.refresh();
},scope: this
}
}
});
}
console.log(this.menu.record);
this.updateTestwindow.setValues(this.menu.record);
this.updateTestwindow.show(e.target);
}
xtype: 'test-window-updatetest',is very easy
Test.window.UpdateItems = function(config) {
config = config || {};
Ext.applyIf(config,{
title: 'Editing film data',autoHeight: false,height: 600,width: 1000,autoScroll : false,url: Test.config.connectorUrl,fields: [
{
xtype: 'hidden',name: 'id'
},{
xtype: "panel",items: [
{
layout: "form",title: "text",{
xtype: "modx-tabs",deferredRender: false,cls: 'modx-tabs',plain: true,activeTab: 0,items: [
{
xtype:"panel",title:"Main information",items:[{
xtype: 'xcheckBox',title: 'VIEW',handler: function() {
console.log(parseInt(config.record.view_index))
}
}]
},]
}
]
}
]
});
Test.window.UpdateItems.superclass.constructor.call(this,config);
};
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)