[CLOSED] Load grid with another grid data

Page 3 of 4 FirstFirst 1234 LastLast
  1. #21
    Here you are getting a RowExpander's component for a specific row/record.
    http://forums.ext.net/showthread.php...l=1#post192691
  2. #22
    Thanks daniil,
    But how I do this on button click

    Html.X().Button()
                                            .ID("btnAdd")
                                            .Text("Add record")
                                            .Icon(Icon.Add)
                                           .Listeners(l => { l.Click.Handler = "var v=App.RowExpander1.getComponent(record).getStore();console.log(v)"; })
    Its through a javascript error

    ReferenceError: record is not defined
  3. #23
    Probably, you need to iterate all the records of the Store of the GridPanel that holds the RowExpander. At least, I would try it.
  4. #24
    so ,I have to loop through sourcegrid's store?
    I am confused,can you please provide some code sample.

    I try

      .Listeners(l => { l.Click.Handler = @"var v=App.sourcegrid.getStore();
                                                                                v.each(function(v1) {
                                                                                    console.log(v1.data);
                                                                                });
                                                                         "; })
    its return data from sourcegrid but I need selected row/data from regrid.
    Last edited by matrixwebtech; Sep 16, 2014 at 9:37 AM.
  5. #25
    You need to use the sourcegrid's records in the rowExpander.getComponent(record) call. This way you should be able to get a regrid for each row.
  6. #26
    Hi daniil,
     .Listeners(l =>
                                              {
                                                  l.Click.Handler = @"var records=App.sourcegrid.getStore();
                                                                        
                                                                                records.each(function(record) {
                                                                                   
                                                                                   onClick(App.RowExpander1.getComponent(record),#{targetgrid})
                                                                                });
                                                                         ";
                                              })
     
    var onClick = function (sourcegrid,targetgrid) {
              
               var values = sourcegrid.getSelectionModel().getSelection();
               sourcegrid.getStore().remove(values)
               var store = targetgrid.getStore();
               store.loadData(values,true)
               
           }
    Code working with javascript error
    TypeError: sourcegrid is null
    can you please help?
  7. #27
    I guess if "sourcegrid is null" it means that a row has not been expanded yet.

    You can wrap it in the "if" statement like that:
    if (sourcegrid) {
        // do the required with the sourcegrid
    }
  8. #28
    Hi daniil
    one more thing I want to perform ,

     if (sourcegrid.getStore().getCount() <= 0) {
                   
               }
    then remove this row along with RowExpander from the grid which holds RowExpander .can you please tell me what I have to for this?
  9. #29
    Please clarify were you able to achieve the initial requirement first?
  10. #30
    after adding from regrid to targetgrid if all record from source grid add to target then remove the specific row from sourcegrid
Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. [CLOSED] Load data to Grid on Documenet ready
    By matrixwebtech in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 18, 2014, 8:21 AM
  2. [CLOSED] Load Mask Not displaying on Grid Panel data load
    By WHISHWORKS in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 17, 2013, 3:44 PM
  3. Replies: 0
    Last Post: May 16, 2013, 6:46 AM
  4. load grid after draged data
    By krlos02 in forum 1.x Help
    Replies: 1
    Last Post: Sep 01, 2011, 3:28 PM
  5. how to load data to grid panel in page load
    By andylaiyongsing in forum 1.x Help
    Replies: 1
    Last Post: Apr 16, 2010, 10:27 AM

Posting Permissions