mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 09:05:16 +01:00
itempicker update
This commit is contained in:
parent
2fbf1d36e8
commit
ac98f4f06a
10
etemplate/js/et2_extension_itempicker_actions.js
Normal file
10
etemplate/js/et2_extension_itempicker_actions.js
Normal file
@ -0,0 +1,10 @@
|
||||
function itempickerDocumentAction(context, data) {
|
||||
var formid = "itempicker_action_form";
|
||||
var form = "<form id='" + formid + "' action='index.php?menuaction=" + data.app + "." + data.app + "_merge.download_by_request' method='POST'>"
|
||||
+ "<input type='hidden' name='data_document_name' value='" + data.value.name + "' />"
|
||||
+ "<input type='hidden' name='data_document_dir' value='" + data.value.dir + "' />"
|
||||
+ "<input type='hidden' name='data_checked' value='" + data.checked.join(',') + "' />"
|
||||
+ "</form>";
|
||||
$j("body").append(form);
|
||||
$j("#" + formid).submit().remove();
|
||||
}
|
@ -19,6 +19,7 @@
|
||||
jquery.jquery;
|
||||
et2_core_inputWidget;
|
||||
et2_core_valueWidget;
|
||||
et2_extension_itempicker_actions;
|
||||
egw_action.egw_action_common;
|
||||
*/
|
||||
|
||||
@ -52,6 +53,12 @@ var et2_itempicker = et2_inputWidget.extend({
|
||||
"default": et2_no_init,
|
||||
"description": "This text get displayed if an input-field is empty and does not have the input-focus (blur). It can be used to show a default value or a kind of help-text."
|
||||
},
|
||||
"value": {
|
||||
"name": "value",
|
||||
"type": "any",
|
||||
"default": "",
|
||||
"description": "Optional itempicker value(s) - can be used for e.g. environmental information"
|
||||
},
|
||||
"query": {
|
||||
"name": "Query callback",
|
||||
"type": "any",
|
||||
@ -185,7 +192,8 @@ var et2_itempicker = et2_inputWidget.extend({
|
||||
{
|
||||
var data = {};
|
||||
data.app = this.current_app;
|
||||
data.items = this.getSelectedItems();
|
||||
data.value = this.options.value;
|
||||
data.checked = this.getSelectedItems();
|
||||
return this.action.exec(this, data);
|
||||
}
|
||||
|
||||
@ -194,7 +202,7 @@ var et2_itempicker = et2_inputWidget.extend({
|
||||
|
||||
getSelectedItems: function()
|
||||
{
|
||||
var items = {};
|
||||
var items = [];
|
||||
$j(this.itemlist).children("ul").children("li.selected").each(function(index) {
|
||||
items[index] = $j(this).attr("id");
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user