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

Using Checkcolumn

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

  • Using Checkcolumn

    I am trying to use the checkcolumn to allow the user to check a line when it has been processed.
    I finally discovered the checkchange listener and thought I was on the right road. But I do not understand how to get the data form the record so that I can update the record on the iSeries.
    Here is the column info
    Code:
    onCheckcolumnCheckChange: function(checkcolumn, rowIndex, checked, eOpts) {
                                xtype: 'checkcolumn',
                                dataIndex: 'FLAG01',
                                text: 'Processed',
                                listeners: {
                                    checkchange: {
                                        fn: me.onCheckcolumnCheckChange,
                                        scope: me
                                    }
                                }
    Here is the checkchange code, I added some alerts to be sure I was getting to this point and what record I was looking at.
    Code:
    alert(checkcolumn);
    alert(rowIndex);
    alert(checked);
    alert(eOpts);
    
    Ext.Ajax.request({
        url: '/valence/vvcall.pgm',
        params: {
            pgm: 'AC1028',
            action: 'updateRec' ,
            VVRRN: component.currentRec,
            FLAG01 : component.getValue()
        },
        success: function(response) {
            var r = Ext.decode(response.responseText);
            if (r.success) {
                Valence.util.Helper.msg('Record saved.');
                Ext.ComponentQuery.query('#filegrid')[0].getStore().load();
            } else {
                Valence.util.Helper.msg('ERROR: ' + r.msg);
            }
        }
    });
    So my question is, Am I on the right track and how do I get the VVRRN number to be able to update the master record?

    Thank you.

  • #2
    Hi Clifford,

    I don't see what would be the value of component.currentRec from your post. May be you setting this value in rowclick event? In any case, you may get the selected record from the 'rowIndex' passed with 'checkchange' function. Something like yourStore.getAt(rowIndex). I hope that answers your question.

    Thanks,

    Sama

    Comment


    • #3
      Hi Sama,

      I noticed that this is in the wrong thread. Should I move it to 4.x?
      I tried your example with no luck at all.
      The .getAt from what I am reading uses the model not the store.

      My model and store are called Main.
      Store
      Code:
      Ext.define('AC1028.store.Main', {
          extend: 'Ext.data.Store',
      
          requires: [
              'AC1028.model.Main',
              'Ext.util.Sorter'
          ],
      
          constructor: function(cfg) {
              var me = this;
              cfg = cfg || {};
              me.callParent([Ext.apply({
                  autoLoad: true,
                  model: 'AC1028.model.Main',
                  remoteSort: true,
                  storeId: 'main',
                  sorters: {
                      property: 'STRNUM'
                  }
              }, cfg)]);
          }
      });
      Model
      [CODE]
      Ext.define('AC1028.model.Main', {
      extend: 'Ext.data.Model',

      requires: [
      'Ext.data.Field',
      'Ext.data.proxy.Ajax',
      'Ext.data.reader.Json'
      ],

      fields: [
      {
      name: 'VVRRN'
      },
      {
      name: 'STRNUM'
      },
      {
      name: 'TRANDATE'
      },
      {
      name: 'TRANTIME'
      },
      {
      Processed: function() {
      return (flag === "X") ? true : false;
      },
      name: 'FLAG01'
      }
      ],

      proxy: {
      type: 'ajax',
      extraParams: {
      pgm: 'AC1028',
      action: 'getRecs'
      },
      url: '/valence/vvcall.pgm',
      reader: {
      type: 'json',
      root: 'recs',
      totalProperty: 'totalCount'
      }
      }
      });
      [\CODE]

      Thank you for your help.

      Comment


      • #4
        Hi Clifford,

        .getAt method of the store should return the record at that index (http://docs.sencha.com/extjs/4.1.1/#...e-method-getAt). If you can post code where and how you implemented this method to fetch the record, that would be helpful.

        Thanks,

        Sama

        Comment

        Working...
        X