This is a migrated thread and some comments may be shown as answers.

[Solved] Grid Refresh Action

0 Answers 32 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
vivek
Top achievements
Rank 1
vivek asked on 09 Nov 2011, 08:37 PM
I have a Telerik grid and i have created a tool bar on top of the grid for performing some actions for either single or multiple records.
The first column I have in the grid is check box template. It lets user select one or more records and then you can select a particular action from the toolbar. 
For example, I select a row and try to activate the user. I am able to do this action. After the action is been performed, i refresh the result and hence the telerik grid. Now if i select the same record and select a different action, it does not do anything. It still calls the first action that i performed. If i refresh the whole page or search result and then try to do a different action with the same record then it works. 
It let me to believe that the page/grid does not refresh after i perform a action. I have to manually either refresh the search result or load the grid again.

Do you know how to resolve this refresh issue? I am using AJAX Binding and here is the code for refreshing my grid.

PostAction = function (gridId, actionName, postURL, data, callback) {
        $.ajax({
            type: 'POST',
            url: postURL,
            data: data,
            success: function (result) {
                if (result.ok) {
                    PostRefresh(gridId, result);
                    
                    if (callback)
                        callback();
                }                
            }
        });
    };

 PostRefresh = function (gridId, result) {
        if (result.refresh || result.ok) {
            $('input:checkbox:checked', gridId).attr('checked', false);
            updateActionAvailability(gridId);
            $(gridId).data('tGrid').ajaxRequest();
        }
    };



Tags
Grid
Asked by
vivek
Top achievements
Rank 1
Share this question
or