1
我有一个gridpanel有两列,第一列显示用户名,第二列是一个带编辑按钮的动作列,当点击编辑按钮时,通过显示一个带窗体的窗口并输入新密码来更改用户密码。extjs通过param形式
如何将“用户名”传递给窗体并显示。 我正在尝试使用Store。 还有别的办法吗?
我的代码
gridpanelview.js
actioncolumn:
/*...config*/
{
xtype: 'actioncolumn',
items: [
{
handler:function(view, rowIndex, colIndex, item, e, record, row) {
var pwdwin = Ext.create('myapp.view.SetPwdWin');
var store = Ext.create(myapp.store.mystore)
mysore.setData(record)
pwdwin.show();
},
icon: 'edit.png',
tooltip: 'change passpword'
}]
}
mywindow.js:
/*...config*/
dockedItems: [
{
xtype: 'form',
dock: 'top',
reference: 'form',
height: 200,
id: 'pwd_form',
bodyPadding: 10,
header: false,
title: 'My Form',
layout: {
type: 'vbox',
align: 'center'
},
items: [
{
xtype: 'textfield',
flex: 1,
id: 'user_name',
maxHeight: 20,
padding: 10,
fieldLabel: 'Name',
editable: false
},
{
xtype: 'textfield',
id: 'new_pwd',
padding: 10,
fieldLabel: 'Password',
inputId: 'new_pwd_value',
inputType: 'password',
allowBlank: false,
maxLength: 20,
minLength: 6
},
{
xtype: 'textfield',
id: 'confirm_pwd',
fieldLabel: 'confirm',
inputId: 'confirm_pwd_value',
inputType: 'password',
allowBlank: false,
maxLength: 20,
minLength: 6
},
{
xtype: 'button',
text: 'OK',
listeners: {
click: 'set_new_pwd'
}
}
]
}
],
set_form_username: function() {
//get Store data
form = this.getReferences().form.getForm();
//how to set username to the label
}
set_new_pwd: function(button, e, eOpts) {
//send username and new username to server
}