• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

[SOLVED] Proxy totalProperty?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [SOLVED] Proxy totalProperty?

    Trying to find an answer on a couple things about proxy.

    1) does ExtJs by default compute the totalProperty or is the valence server program sending it back unless skipCountCalc='1'

    2) Once the totalProperty is returned with a value. how can you get it's value into a variable?

  • #2
    Valence sends it back, you can configure the field it looks for in the reader:

    http://docs.sencha.com/extjs/4.1.3/#...-totalProperty


    2) console.log() your store. check out the proxy and reader etc. you'll find the actual data returned from the server somewhere in there. In an ajax call it is in the response.jsonData

    Comment


    • #3
      Yes, I knew how to configure it, etc. What I was wondering is from a performance standpoint, if I could get a reference to the value it contained, then I would not have to do a store.getTotalCount() or iterate through the store to count the records.

      It seems though that the getTotalCount method might be doing this, but I couldn't tell for sure.

      Comment


      • #4
        Don't forget, you can click "View Source" in the API. Here is what getTotalCount source looks like:

        Code:
        getTotalCount: function() {
           return this.totalCount || 0;
        },

        Comment


        • #5
          i do forget that a lot... thanks!

          Comment


          • #6
            No problem, gotta do what ya gotta do!

            Comment

            Working...
            X