extjs EditorGridPanel自动赋值无法显示的问题,extjs高手请进
varcm=newExt.grid.ColumnModel([{header:"检测方法",width:300,id:'test111',dataIndex:'testm...
var cm = new Ext.grid.ColumnModel([
{ header:"检测方法",
width:300,
id:'test111',
dataIndex:'testmethod',
align : "center",
//hidden:true,
editor : new Ext.form.TextField({
allowBlank : false
})
var tp = new Ext.data.Record.create([{
name:"testmethod",
type:"string",
mapping:"testmethod"}]);
var grid = new Ext.grid.EditorGridPanel({
tbar:[{
text:"新增",
handler:function(){
var p = new tp({
testmethod:"aaa"
});
grid.stopEditing();
store.insert(0, p);
grid.startEditing(0, 1);
},{
text:"数据生成",
handler:function(){
var selModel = grid.getSelectionModel();
var record;
if (!selModel.hasSelection()) {
Ext.Msg.alert("警告", "请选择要修改的行!");
} else {
Ext.Msg.confirm("确认", "你确定要为已选择的记录生成数据吗?",
function(btn) {
if (btn == "yes") {
var s = grid.getSelectionModel().getSelections();
for (var i = 0, r; r = s[i]; i++) {
var fm = r.data;
fm.testmethod='TWA:2L/min,15min,STEL:1L/min,120min';
}]
现在的状态就是当我选中一条数据,点数据生成的时候,看到grid里的testmethod列现实的还是aaa,当我在这列上点下去,就出现了可编辑框,里面存的却是'TWA:2L/min,15min,STEL:1L/min,120min',请高手指点,我怎么才能在点数据生成的时候看到的是TWA:2L/min,15min,STEL:1L/min,120min,望高手指教!!!!!!!! 展开
{ header:"检测方法",
width:300,
id:'test111',
dataIndex:'testmethod',
align : "center",
//hidden:true,
editor : new Ext.form.TextField({
allowBlank : false
})
var tp = new Ext.data.Record.create([{
name:"testmethod",
type:"string",
mapping:"testmethod"}]);
var grid = new Ext.grid.EditorGridPanel({
tbar:[{
text:"新增",
handler:function(){
var p = new tp({
testmethod:"aaa"
});
grid.stopEditing();
store.insert(0, p);
grid.startEditing(0, 1);
},{
text:"数据生成",
handler:function(){
var selModel = grid.getSelectionModel();
var record;
if (!selModel.hasSelection()) {
Ext.Msg.alert("警告", "请选择要修改的行!");
} else {
Ext.Msg.confirm("确认", "你确定要为已选择的记录生成数据吗?",
function(btn) {
if (btn == "yes") {
var s = grid.getSelectionModel().getSelections();
for (var i = 0, r; r = s[i]; i++) {
var fm = r.data;
fm.testmethod='TWA:2L/min,15min,STEL:1L/min,120min';
}]
现在的状态就是当我选中一条数据,点数据生成的时候,看到grid里的testmethod列现实的还是aaa,当我在这列上点下去,就出现了可编辑框,里面存的却是'TWA:2L/min,15min,STEL:1L/min,120min',请高手指点,我怎么才能在点数据生成的时候看到的是TWA:2L/min,15min,STEL:1L/min,120min,望高手指教!!!!!!!! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询