Update grid from Server Side

  1. #1

    Update grid from Server Side

    Hi,
    I need to update a grid rows from the server side. I don´t want to
    do a DataBind (BD), is it possibile? Any have an sample?
    Tks.
    Maia.

  2. #2

    RE: Update grid from Server Side

    In a validateedits event - I update it with:




    ScriptManager1.AddScript("store.getById('{0}').set ('" + field2 + "', '{1}');", id, code);
  3. #3

    RE: Update grid from Server Side

    Some other bread-and-butter functions when working with Gridpanels:

    function deleteRecords(grid) {
        var selected = grid.getSelectionModel().getSelections();
        for (var i = 0; i < selected.length; i++) {
            grid.store.remove(selected[i]);
        }
    
    
    }
    
    
    function insertRecord(grid) {
        grid.stopEditing();
        var iNextIndex = grid.getStore().getCount();
        grid.insertRecord(iNextIndex, {});
        grid.getView().focusRow(iNextIndex);
        grid.startEditing(0, iNextIndex);
    }
    
    
    /******************************************************************
    *   Manages firing off the NoteWindow for each record note
    *********************************************************************/
    var cellClick = function(grid, rowIndex, columnIndex, e) {
        var t = e.getTarget();
        var record = grid.getStore().getAt(rowIndex);  // Get the Record
        var columnId = grid.getColumnModel().getColumnId(columnIndex); // Get column id
        // act on clicks to the Notes cell
        if (t.className == 'noteEdit' &amp;&amp; columnId == 'Note') {
            Ext.Msg.prompt('Notes:', t.embedded, function(btn, text) {
                if (btn == 'ok') {
                    // process text value...
                    if (text != '') {
                        record.set('Note', text);
                    }
                }
            });
        }
    }
    
    
    <ext:Button ID="btnAddRow" runat="server" Icon="Add" Text="Add Line">
                            <Listeners>
                                <Click Handler="insertRecord(#{TimeCardGrid});" />
                            </Listeners>
                            <ToolTips>
                                <ext:ToolTip  Target="btnAddRow" Html="Adds an empty line to the current weekly chart." HeaderAsText="true" Title="Add Line Button">
                                </ext:ToolTip>  
                            </ToolTips>
                        </ext:Button>
  4. #4

    RE: Update grid from Server Side

    Hi,
    Thanks for the feedback Juls and Tbaseflug.
    But, on the side Server, for Delete Row grid, what's the command?
    I trying this:
    this.ScriptManagerProxy1.AddScript(string.Format("{0}.deleteSelected();", this.GridStore.ClientID));
    Error:
    uc2_StoreProspect.deleteSelected is not a function
    Tks.
    Maia.

Similar Threads

  1. [CLOSED] ProgressBar Server Side Update
    By Marcelo in forum 1.x Legacy Premium Help
    Replies: 14
    Last Post: May 31, 2017, 12:59 AM
  2. Update data and refreshing grid on server-side !
    By Aleksa007 in forum 1.x Help
    Replies: 0
    Last Post: Mar 03, 2011, 12:25 AM
  3. Replies: 18
    Last Post: Sep 27, 2010, 3:06 PM
  4. Update Store on Server Side
    By Tbaseflug in forum 1.x Help
    Replies: 2
    Last Post: Jan 14, 2009, 5:59 PM
  5. Replies: 3
    Last Post: Oct 24, 2008, 2:05 PM

Posting Permissions