开发者

Load method of Ext.data.store - how to delay a return statement AND a function call until the data is loaded?

开发者 https://www.devze.com 2023-02-13 00:26 出处:网络
connectLoadRenderStoreAndGetCheckBox: function () { this.someStore = new Ext.data.Store({ proxy: reader:
connectLoadRenderStoreAndGetCheckBox: function () {
    this.someStore = new Ext.data.Store({
        proxy:
        reader:
        ]),
        sortInfo: { field: , direction: }
    });

    this.someStore.load(
    {
        params:
      {

      }
    });
    //I left out parameters; lets assume they are valid and work.
    this.someStore.on("load", this._renderColumns, this);
    return ([this._getCheckBox()]);
}

On 'load' I want to both execute the function this._renderColumns (which uses the data from the server) and also return a checkbox (which also uses data from the server). What is a quick & easy way to only return the checkbox after the data is loaded?

_getCheckBox: function () {
    if (UseDefault == "y") {
        return new Ext.form.Checkbox(
        {
          开发者_开发问答  fieldLabel:,
            itemCls:,
            checked: true,
            labelStyle:
        });
    }
    else {
        return new Ext.form.Checkbox(
        {
            fieldLabel:,
            itemCls:,
            checked: false,
            labelStyle:
        });
    }
},
_renderColumns: function () {
    var record2 = this.something.something2(2);
    UseDefault = record2.get("UseDefault");
}
0

精彩评论

暂无评论...
验证码 换一张
取 消