function signature for new nextmatch refresh method, already working clientside by calling applyFilters, but should be smarter, serverside will require row-data plugin on clientside

This commit is contained in:
Ralf Becker 2013-02-18 09:47:39 +00:00
parent 89ec3ba866
commit 4ab0aaab9f
2 changed files with 35 additions and 0 deletions

View File

@ -800,6 +800,22 @@ class etemplate_widget_nextmatch extends etemplate_widget
if(is_array(self::$request->preserve[$cname])) unset(self::$request->preserve[$cname][$key]);
}
}
/**
* Refresh given rows for specified change
*
* Change type parameters allows for quicker refresh then complete server side reload:
* - edit: send just modified data from given rows
* - delete: just send null for given rows to clientside (no backend call neccessary)
* - add: requires full reload
*
* @param array|string $row_ids rows to refresh
* @param string $type='edit' "edit" (default), "delete" or "add"
*/
public function refresh($row_ids, $type='edit')
{
throw new Exception('Not yet implemented');
}
}
// Registration needs to go here, otherwise customfields won't be loaded until some other cf shows up

View File

@ -254,6 +254,25 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput], {
// Trigger an update
this.controller.update();
},
/**
* Refresh given rows for specified change
*
* Change type parameters allows for quicker refresh then complete server side reload:
* - edit: request just modified data from given rows
* - delete: just delete the given rows clientside (no server interaction neccessary)
* - add: requires full reload
*
* @param array|string _row_ids rows to refresh
* @param string _type "edit" (default), "delete" or "add"
*/
refresh: function(_row_ids, _type) {
if (typeof _type == 'undefined') _type = 'edit';
if (typeof _row_ids == 'string') _rowids = [_row_ids];
// ToDo: use given context, to be more smart about what to change
this.applyFilters();
}
/**
* Generates the column caption for the given column widget