投放本站广告请联系:
extjscn#126.com
请麻烦老大给个帮助。我头都想破了
我是想完成这样一个效果。
一个Grid列表。我双击就能弹出一个界面让我修改这个数组的数据。
弹出来倒应该是可以,但是我如何做到使这个表单内容是我双击的那一列的呢。
我到网上找了N久,结果全是1.X版本下的转帖。。。我还拿着测试半天,后来在国外论坛上看到这个是1.X的。
我现在的代码是这样的。只贴了一部分。我QQ405614104.MSN:bdrs_web@hotmail.com
希望能得到老大的帮助。我头都想破了。。。。不知道该怎么办了。
我很真诚的希望老大能帮上我。。。谢谢
想要的效果是这个链接下的。。
http://www.feyasoft.com/home.htm
/************************************************************
* Create form to hold user enter information
* This form is used to update current instance
************************************************************/
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';
//建立这个是为下面双击事件服务的。
var name_show = new Ext.form.TextField({
xtype:'textfield',
fieldLabel: '文章标题 ',
name: 'name',
anchor:'90%',
allowBlank:false});
var typename_show = new Ext.form.TextField({
xtype:'textfield',
fieldLabel:'文章类别',
name: 'typename',
anchor:'90%',
allowBlank:false});
var form_instance_update = new Ext.form.FormPanel({
labelWidth: 75, // label settings here cascade unless overridden
url:'php/article_edit.php?action=updateAccount',
frame:true,
title: '更新文章',
bodyStyle:'padding:5px 5px 0',
width: 350,
defaults: {width: 230},
defaultType: 'textfield',
items: [{
这里是表单内容。怎么写?
},{
这里也是。。不知道写。
}
],
buttons: [{
text: 'Save'
},{
text: 'Cancel'
}]
});
form_instance_update.render('a-updateInstance-form');
/************************************************************
* Action - update
* handle double click
* user select one of the item and want to update it
************************************************************/
grid.on('rowdblclick', function(grid, rowIndex, e) {
var selectedId = ds.getAt(rowIndex).id;
// Get information from DB and set form now...
// Only need to use a ScriptTagProxy if the URL is at another domain
var account_data = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url:'php/article_edit.php?id=' + selectedId}),
reader: new Ext.data.JsonReader({},['id','name','typename']),
remoteSort: false
});
account_data.on('load', function() {
// set value now
var newRec = account_data.getAt(0);
var updateId = newRec.data['id'];
name_show.setValue(newRec.get('name'));
typename_show.setValue(newRec.get('typename'));
var updateInstanceDlg;
if (!updateInstanceDlg) {
updateInstanceDlg = createNewDialog("a-updateInstance-dlg");
updateInstanceDlg.addButton('保存修改', function() {
// submit now... all the form information are submit to the server
// handle response after that...
if (form_instance_update.isValid()) {
form_instance_update.submit({
params:{id : updateId},
waitMsg:'正在保存修改...',
reset: false,
failure: function(form_instance_update, action) {
Ext.MessageBox.alert('Error Message', action.result.errorInfo);
},
success: function(form_instance_update, action) {
Ext.MessageBox.alert('Confirm', action.result.info);
updateInstanceDlg.hide();
ds.load({params:{start:0, limit:myPageSize}});
}
});
}else{
Ext.MessageBox.alert('Errors', 'Please fix the errors noted.');
}
});
var layout = updateInstanceDlg.getLayout();
layout.beginUpdate();
layout.add('center', new Ext.ContentPanel('a-updateInstance-inner', {title: '跟新文章'}));
layout.endUpdate();
updateInstanceDlg.show();
}
});
account_data.load();
}); - 要发表评论,请先登录


找到解决方案。。。
找到解决方案。。。早知道就不用找了。下次不搞这种蠢事了。他网站没源文件。但是右键后的源文件里下下来就可以看了。。。。
找到解决办法啦,
有机会拿出来跟大家分享一下!