• 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.

Sorting by two fields

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

  • Sorting by two fields

    I have an inquiry with some fields in a grid, and I'd like to sort the records by two fields... first vendor, and then document #.

    I have specified two sorters on my Main store, but my grid still only seems to sort on the vendor field, not also by the document # within each vendor.

    Code:
    Ext.define('VXOPENPO.store.Main', {
        extend: 'Ext.data.Store',
    
        requires: [
            'VXOPENPO.model.Main',
            'Ext.util.Sorter'
        ],
    
        constructor: function(cfg) {
            var me = this;
            cfg = cfg || {};
            me.callParent([Ext.apply({
                autoLoad: true,
                model: 'VXOPENPO.model.Main',
                storeId: 'main',
                sorters: [
                    {
                        property: 'VENDOR'
                    },
                    {
                        property: 'DOCUMENT'
                    }
                ]
            }, cfg)]);
        }
    });
    The SQL statement in the backend RPG does not have an ORDER BY clause.

    Any ideas?

  • #2
    Bueller...?

    :-)

    Comment


    • #3
      What does your back-end code look like? If it has no order by how are you specifying the order?

      Comment


      • #4
        The backend SQL does not have an order by. The sorter shown above causes the data to be sorted by vendor. But the data is not sorted by Document within Vendor like I was hoping.

        Comment


        • #5
          Try specifying "remoteSort" : true on your store and ensure that the back-end has vvOut.applySorters set to "1" or "Y".

          Comment


          • #6
            I did already have applySorters set on, but I didn't have remoteSort : true on my store. Adding that seems to have fixed it. Thanks!

            Comment

            Working...
            X