DataView loadingText not displaying

  • Hi all, i'm new to ExtJs... but am extremely impressed!

    Here's my issue. I have configured a DataView with some loadingText='it is loading...', the dataview's store is a JsonStore. the JsonStore gets loaded with data via the loadData() method. Everything works great except the loadingText is never displayed.

    what am i missing?

    thanks in advanced.


  • That's probably not the best way to do it... but hey, if it works.


  • Ext.onReady(function() {
    var ascDesc = 'ASC';
    var store = new Ext.data.JsonStore({
    root: '',
    fields: ['Id', 'DisplayName', 'DateUpdated'
    , 'Product', 'ProductGroup', 'FileId', { name: 'SizeBytes', type: 'int' }
    , { name: 'AssetTypeId', type: 'int' }, 'FileSize', 'FileExtension'
    ]
    });
    PageMethods.GetAssets("", "", "", get_AssetsComplete);
    var tpl = new Ext.XTemplate(
    '',
    '',
    '


  • i'll post in a moment if needed...

    i retrieve data from a ASP.NET pagemethod. I guess it makes sense that i'm passing the rawdata once it has already been downloaded, and such that there is no triggering of any other events.

    is there a way to either fire off the display of the loadingText programatically or even fire the onbeforeload event which i assume would fire the loadingText??

    thanks for the quick reply!!


  • Ext.onReady(function() {
    var ascDesc = 'ASC';
    var store = new Ext.data.JsonStore({
    root: '',
    fields: ['Id', 'DisplayName', 'DateUpdated'
    , 'Product', 'ProductGroup', 'FileId', { name: 'SizeBytes', type: 'int' }
    , { name: 'AssetTypeId', type: 'int' }, 'FileSize', 'FileExtension'
    ]
    });
    PageMethods.GetAssets("", "", "", get_AssetsComplete);
    var tpl = new Ext.XTemplate(
    '',
    '',
    '


  • In general it's up to the class itself to fire the event, because:

    1) An event is represented by a change in state in the class
    2) The class knows which parameters to pass to the handler.

    I'd do something like:


    Ext.override(Ext.DataView,
    {
    showLoading: function()
    {
    if(this.loadingText){
    this.clearSelections(false, true);
    this.el.update(''+this.loadingText+'


  • What do you think the best way would be? I'm always open to suggestions.


  • loadData means you're loading local data, so it's probably loading "too quickly".

    Post your code.


  • Much much cleaner!!!

    Thanks much!


  • I figured it out... i just needed to add the store.fireEvent('beforeload') prior to the code that retrieves the data.

    Thanks for your attention!


  • Post code in code tags, see: http://extjs.com/forum/misc.php?do=bbcode

    Yeah, so before you make your ajax request, you need to do something like:


    myView.onBeforeLoad(); //private method


    LoadingText will only work if you have the store actually load the data for you, since it will handle the ajax request.


  • Ext.onReady(function() {
    var ascDesc = 'ASC';
    var store = new Ext.data.JsonStore({
    root: '',
    fields: ['Id', 'DisplayName', 'DateUpdated'
    , 'Product', 'ProductGroup', 'FileId', { name: 'SizeBytes', type: 'int' }
    , { name: 'AssetTypeId', type: 'int' }, 'FileSize', 'FileExtension'
    ]
    });
    PageMethods.GetAssets("", "", "", get_AssetsComplete);
    var tpl = new Ext.XTemplate(
    '',
    '',
    '







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about DataView loadingText not displaying , Please add it free.

    7 January 2009 | cameltoepants.com | edit