zoukankan      html  css  js  c++  java
  • Extjs之遍历Store内的数据

    Store作为数据的载体,通过下面的方法可以获得Store内的数据;

     1 Ext.define('haomlGeimjTongjGrid_store_data', {
     2     extend: 'Ext.data.Model',
     3     fields: ['id', 'jizcode', 'name', 'gaokgl', 'gaokdl', 'dikgl', 'dikdl', 'liezy', 'mein', 'hem']
     4 });
     5 var haomlGeimjTongjGrid_store = Ext.create('Ext.data.Store', {
     6     model: 'haomlGeimjTongjGrid_store_data',
     7     proxy: {
     8         url: '../haomglerq/getHaomlGeimjTongj',
     9         type: 'ajax',
    10         reader: {
    11             root: 'datas',
    12             type: 'json'
    13         }
    14     }
    15 });
    16 var results = '[';
    17 haomlGeimjTongjGrid_store.each(function(record){//get的名字要与Store绑定的Model的名字是一样的
    18     var info = 'id:' + record.get('id') + ',jizcode:' + record.get('jizcode') + ',name:' + record.get('name') + 
    19     ',gaokgl:' + record.get('gaokgl') + ',gaokdl:' + record.get('gaokdl') + ',dikgl:' + record.get('dikgl') + 
    20     ',dikdl:' + record.get('dikdl') + ',liezy:' + record.get('liezy') + 
    21     ',mein:' + record.get('mein') + ',hem:' + record.get('hem');
    22     results = results + Ext.JSON.encode(info) + ',';
    23 });
    24 results = results + ']';
  • 相关阅读:
    Jquery
    JavaScript
    poj--2115 C Looooops
    poj--3970 party
    poj 1061 青蛙的约会
    hdu1250--Hat's Fibonacci
    2318--TOYS
    扩展欧几里得--让你一次刷个够
    关于大数加法的解法
    有关环形数组的约瑟夫问题
  • 原文地址:https://www.cnblogs.com/smallrock/p/3656894.html
Copyright © 2011-2022 走看看