GridPanel add/remove record on client side

  1. #1

    GridPanel add/remove record on client side

    I am upgrading a project for coolite 0.8 to ext.net 2.2

    I have two GridPanel in my form, I want to add a button to move a selected record on one of the GidPanel to the other one.

    Button defined in designer
                                                                                    <ext:Button ID="Button1" runat="server" Icon="ResultsetNext" StyleSpec="margin-bottom:2px;">
                                                                                        <Listeners>
                                                                                            <Click Handler="ReportFieldSelector.add(Source, Target);" />
                                                                                        </Listeners>
                                                                                    </ext:Button>
    JS
    var ReportFieldSelector = {
        add: function(source, destination) {
            if (source.hasSelection()) {
                destination.store.add(source.selModel.getSelections());
                source.deleteSelected();
            }
        }
    };
    The JS codes are work on coolite 0.8.

    I have read the document for extjs 4.2.0 and find that I can get the selected row by getSelectionModel( ) .

    However I cannot find a method getSelectionModel() for "source" or "destination" when I insert a break point at the JS.

    How can I do that correctly? Or should I move this function to server side by implementing DirectEvent?
  2. #2

Similar Threads

  1. Replies: 4
    Last Post: Sep 28, 2016, 10:35 AM
  2. Replies: 1
    Last Post: Apr 25, 2013, 10:56 PM
  3. Replies: 2
    Last Post: Feb 20, 2013, 12:53 AM
  4. Delete or remove record from gridpanel
    By lapix in forum 1.x Help
    Replies: 3
    Last Post: Feb 25, 2012, 5:56 PM
  5. [CLOSED] detect new store record on client side
    By pschojer in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 14, 2009, 8:42 AM

Posting Permissions