Results 1 to 9 of 9

Thread: ?????????????

  1. #1

    Default ?????????????

    ext?grid?????????????????
    ????????????????

    ??????????????????????

    ??????????httpProxy??????
    var firstGridStore = new Ext.data.Store({
    //root: 'data',
    //totalProperty: 'totalProperty',
    id: 'index',
    remoteSort: true,
    proxy: new Ext.data.HttpProxy({url: "/sample/app?U=U_SEARCH", method: "GET"}),
    reader: reader
    });

    ???
    firstGridStore.load({params:{start:0, limit:10}});
    ?1???????????????????

    ???start?limit????????????
    ??????????SQL?start?limit??????????????
    ??????????????????????????????
    ???????????????????
    ????????????10??????10????????????
    ???????????????????
    1???????ajax???????????????????????

  2. #2
    Sencha - Support Team yuki's Avatar
    Join Date
    Jun 2007
    Location
    Chigasaki, Japan
    Posts
    273

    Default

    Quote Originally Posted by ak_ext View Post
    ??????????httpProxy??????
    var firstGridStore = new Ext.data.Store({
    //root: 'data',
    //totalProperty: 'totalProperty',
    id: 'index',
    remoteSort: true,
    proxy: new Ext.data.HttpProxy({url: "/sample/app?U=U_SEARCH", method: "GET"}),
    reader: reader
    });
    totalProperty???????????
    Ext Japan, LLC [Twitter: @extjapan]
    [Ext JS / Ext GWT????????][????????????][Ext JS???????????????]

  3. #3

    Default ????????

    ???totalProperty?ext????
    ?????????????????????????????
    root?totalProperty???????????
    ??????????????????

    json???????????????????????????
    {'totalProperty':120,'data':{[data1:'aaa',data2:'bbb'],[data1:'ccc',data2:'ddd']...}}
    ???

  4. #4
    Sencha - Support Team yuki's Avatar
    Join Date
    Jun 2007
    Location
    Chigasaki, Japan
    Posts
    273

    Default

    Quote Originally Posted by ak_ext2 View Post
    {'totalProperty':120,'data':{[data1:'aaa',data2:'bbb'],[data1:'ccc',data2:'ddd']...}}
    ?
    ?
    Code:
    {'totalProperty':120,'data':[{data1:'aaa',data2:'bbb'},{data1:'ccc',data2:'ddd'}...]}
    ????????????????
    Ext Japan, LLC [Twitter: @extjapan]
    [Ext JS / Ext GWT????????][????????????][Ext JS???????????????]

  5. #5

    Default ??????

    ????????????
    {'totalProperty':120,'data':[{data1:'aaa',data2:'bbb'},{data1:'ccc',data2:'ddd'}...]}
    ???
    ????????????????""???????
    ????''???????????????????????????
    ????
    totalProperty ?root???????????????????

  6. #6
    Sencha - Support Team yuki's Avatar
    Join Date
    Jun 2007
    Location
    Chigasaki, Japan
    Posts
    273

    Default ?????

    ?????????????????????????????

    ????????????Firebug???????????????????????????

    • Store????????????????Store?id?????????Ext.StoreMgr.lookup????????
    • ??????????????HttpProxy???load?loadResponse??????????????????????
    • loadResponse???????????request????????????????
    • loadexception??????????????
    • loadResponse???reader?????response??????????


    ??????????????????????????????????

    ?????????????????response?reader??????????????????????????HttpProxy.loadResponse??????????????????????????????????????????????????

    Code:
    try {
      result = o.reader.read(response);
    }catch(e){
      ...
    Ext Japan, LLC [Twitter: @extjapan]
    [Ext JS / Ext GWT????????][????????????][Ext JS???????????????]

  7. #7

    Default ???????????

    id??????Ext.StoreMgr.lookup?????????????????????
    ????reader????????????????

    ??store?getTotalCount()??????0????
    ??????????????????????????
    ?????????????

    ?????store.data??????????
    ????????????????????????

  8. #8

    Default ????

    ext-all.js?readRecords ?
    s.totalProperty??????????????????
    this.jsonData = o???????????????
    ????var s = this.meta?mata??????????
    ???filed??????????totalProperty????????
    ?????????????????????

    store????????????????
    var firstGridStore = new Ext.data.Store({
    root: 'data',
    totalProperty: 'totalProperty',???
    id: 'index',
    remoteSort: true,
    proxy: new Ext.data.HttpProxy({url: "/sample/app?U=U_SEARCH", method: "GET"}),
    reader: reader
    });

    readRecords : function(o){


    this.jsonData = o;
    if(o.metaData){
    delete this.ef;
    this.meta = o.metaData;
    this.recordType = Ext.data.Record.create(o.metaData.fields);
    this.onMetaChange(this.meta, this.recordType, o);
    }
    var s = this.meta, Record = this.recordType,
    f = Record.prototype.fields, fi = f.items, fl = f.length;
    // Generate extraction functions for the totalProperty, the root, the id, and for each field
    if (!this.ef) {
    if(s.totalProperty) {
    this.getTotal = this.getJsonAccessor(s.totalProperty);
    }
    if(s.successProperty) {
    this.getSuccess = this.getJsonAccessor(s.successProperty);
    }
    this.getRoot = s.root ? this.getJsonAccessor(s.root) : function(p){return p;};
    if (s.id) {
    var g = this.getJsonAccessor(s.id);
    this.getId = function(rec) {
    var r = g(rec);
    return (r === undefined || r === "") ? null : r;
    };
    } else {
    this.getId = function(){return null;};
    }
    this.ef = [];
    for(var i = 0; i < fl; i++){
    f = fi[i];
    var map = (f.mapping !== undefined && f.mapping !== null) ? f.mapping : f.name;
    this.ef[i] = this.getJsonAccessor(map);
    }
    }
    var root = this.getRoot(o), c = root.length, totalRecords = c, success = true;
    if(s.totalProperty){
    var v = parseInt(this.getTotal(o), 10);
    if(!isNaN(v)){
    totalRecords = v;
    }
    }

  9. #9

    Default ??????

    ????????????????????

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •