* @param object options
*/
WCF.Sortable.List = Class.extend({
+ /**
+ * additional parameters for AJAX request
+ * @var object
+ */
+ _additionalParameters: { },
+
/**
* action class name
* @var string
* @param integer offset
* @param object options
* @param boolean isSimpleSorting
+ * @param object additionalParameters
*/
- init: function(containerID, className, offset, options, isSimpleSorting) {
+ init: function(containerID, className, offset, options, isSimpleSorting, additionalParameters) {
+ this._additionalParameters = additionalParameters || { };
this._containerID = $.wcfEscapeID(containerID);
this._container = $('#' + this._containerID);
this._className = className;
* Saves object structure.
*/
_submit: function() {
+ // reset structure
+ this._structure = { };
+
// build structure
this._container.find('.sortableList').each($.proxy(function(index, list) {
var $list = $(list);
}, this));
// send request
- this._proxy.setOption('data', {
- actionName: 'updatePosition',
- className: this._className,
- parameters: {
+ var $parameters = $.extend(true, {
data: {
offset: this._offset,
structure: this._structure
}
- }
+ }, this._additionalParameters);
+
+ this._proxy.setOption('data', {
+ actionName: 'updatePosition',
+ className: this._className,
+ parameters: $parameters
});
this._proxy.sendRequest();
},