奋斗的殇鹿 2016-12-29 10:51 采纳率: 36.1%
浏览 825

哪位大神懂ext的。。。本人新手,教教我好不?函数进去了,为啥不会添加一行呢?

listeners : {
scope : this,
'render' : function() {
Ext.Msg.alert('错误', '进来啦!');
new Ext.data.Record({
cust_account : null,
cust_tcisname : null,
cust_phone :'123',
cust_type :null,
cust_address :null,
payment_attr :null,
biling_tactics : null,
biling_regular :null,
newRecord : true
})
}

  • 写回答

1条回答 默认 最新

  • Go 旅城通票 2016-12-29 13:23
    关注

    你只是创建了record,又没有添加到store中,你要哪个grid显示这个记录就更新哪个grid的store

    http://docs.sencha.com/extjs/4.1.3/#!/api/Ext.data.Store-method-add

    
    add( model ) : Ext.data.Model[]
    Adds Model instance to the Store. This method accepts either:
    
    An array of Model instances or Model configuration objects.
    Any number of Model instance or Model configuration object arguments.
    The new Model instances will be added at the end of the existing collection.
    
    Sample usage:
    
    myStore.add({some: 'data'}, {some: 'other data'});
    Note that if this Store is sorted, the new Model instances will be inserted at the correct point in the Store to maintain the sort order.
    
    Available since: 1.1.0
    
    Parameters
    model : Ext.data.Model[]/Ext.data.Model...
    An array of Model instances or Model configuration objects, or variable number of Model instance or config arguments.
    Returns
    Ext.data.Model[]
    The model instances that were added
    Fires
    add
    beforesort
    beforesync
    datachanged
    
    评论

报告相同问题?

悬赏问题

  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条