• 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] Implement popup in grid

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

  • [SOLVED] Implement popup in grid

    I have implemented a popup for selection in a form (identical to the popup example). How do I do this in a grid, I have attached the trigger and get the popup to display but I don't know how to reference the cell it came from for updating the value selected from the popup.

    The code I have, based on the form field version:

    The popup has this
    Code:
    	gridVendors.on('itemclick', function(grid, rec, item, rowIndex, columnIndex, e) {
    		var vendorNum= grid.getStore().getAt(rowIndex).get('KMACCT');
    		window.opener.setVendor(vendorNum);
    		close();
    	});
    And the grid has this:
    Code:
        window.setVendor = function(VendorNum) {
                                 //  Need to replace this with code to update the grid cell value.
    		//formEdit.down('#VENDOR').setValue(VendorNum);
    	};
    If there is an example that does this then just point me at that.

    Thanks,

    Scott Mildenberger
    Last edited by Scott; 09-20-2013, 10:59 AM. Reason: [Solved]

  • #2
    I was able to solve this, for reference this is what I did.

    Created a global variable
    var CellToUpdate;

    Then in the cell with the trigger set the variable to this
    Code:
            onTriggerClick: function(e) {
                        CellToUpdate = this;
            		var newWindow = window.open('vvcall.pgm?app=1007&pgm=vvinit&sid=' + sessionStorage.sid,'tabID1025','height=600,width=500,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,top=100,left=100,location=no,statusbar=no');
    	    		    newWindow.focus();
    		    	}
    And then in the setVendor function to get the return value:
    Code:
        window.setVendor = function(VendorNum) {
               CellToUpdate.setValue(VendorNum);
    	};
    I am still learning so if there is a better way let me know.

    Thanks,

    Scott Mildenberger

    Comment

    Working...
    X