Closed meister-d closed 8 years ago
Hi Dumitru,
You should parse the grid html and gather info about the rows (id, is opened) like this:
var items = [];
$.each(this.$grid.find('.grid_row'), $.proxy(function (idx, val) {
items.push({
Id: $(val).data('objid'),
GetDetails: $(val).hasClass('open')
});
}, this));
Then, you should make an ajax call for the new rows and update the grid's html:
var ajaxOptions = {
name: '|refreshgrid|',
url: this.options.refreshUrl,
data: {
items: items
},
context: this,
success: $.proxy(function (response) {
// update grid html
if (response.RowsHtml) {
this.$grid.bsGrid('updateRows', response.RowsHtml);
}
}, this),
};
$.bforms.ajax(ajaxOptions);
The controller action (refreshUrl
) should look something like this:
public BsJsonResult Refresh(List<BsGridRowData<int>> items)
{
rowsHtml = GetRowsHtml(items);
return new BsJsonResult(new
{
RowsHtml = rowsHtml
}, status, msg);
}
Let me know if you managed to do it
Hi Cristi, this works for me as expected. Thanx ;-)
Regards Dumitru
Hi BForms Team What is the Best way to keep the open Rows open (with Details) when I trigger a Refresh of the Grid.
After pressing the ResetButton (in the BulkActions Buttons), all rows are closed again. Is there a possibility to just refresh the Grid instead of Reset it?
I want to implement some sort of Refresh Timer, which refreshes the current Grid (View) after a certain amount of Time as the Serverside Data changes. After some code mining I came up with something like this:
But unfortunately it seems to have the same behavior like the Reset Button.
Thanx for your Help
Regards Dumitru