Results 1 to 3 of 3

Thread: How to send selected row to FormPanel

  1. #1
    Sencha User
    Join Date
    Nov 2016
    Posts
    7
    Answers
    2
    Vote Rating
    0
      0  

    Default Answered: How to send selected row to FormPanel

    Hello. I've got a grid and toolbar. In toolbar we have "Edit" button, when I press it, edit form (FormPanel) is displayed. How can I send record data, which user selected in Grid to FormPanel to fill fields with data from Grid?
    Code in fiddle: https://fiddle.sencha.com/?extreact#...or&fiddle/29ht

  2. The FormPanel has a setRecord() method which populates the form with the record data. This record can be referenced from the Grid selection and passed to the form. Additionally, you can make edits to the form fields and update them back to the record which will in turn update the grid as well.



    You could even take it a step further and set the selected record to the state which will automatically populate the form since FormPanel has a record prop.


  3. #2
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,495
    Answers
    154
    Vote Rating
    77
      1  

    Default

    The FormPanel has a setRecord() method which populates the form with the record data. This record can be referenced from the Grid selection and passed to the form. Additionally, you can make edits to the form fields and update them back to the record which will in turn update the grid as well.



    You could even take it a step further and set the selected record to the state which will automatically populate the form since FormPanel has a record prop.

    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

  4. #3
    Sencha User
    Join Date
    Nov 2016
    Posts
    7
    Answers
    2
    Vote Rating
    0
      0  

    Default

    Hello! Thank you very much for such immediate answer. Everything works perfectly, thank you!

Similar Threads

  1. How to send the data of selected rows, back to server in a grid.
    By Abhi_aec in forum Sencha Touch 2.x: Q&A
    Replies: 1
    Last Post: 17 Jul 2012, 12:00 PM
  2. Replies: 0
    Last Post: 9 Aug 2011, 6:41 AM
  3. File Upload Send FormPanel ??
    By bureau in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 28 Oct 2010, 1:53 AM
  4. Send combobox selected value to php (JSON)
    By ayoros84 in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 15 Jul 2008, 3:28 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •