mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
add select2 with ajax for getting folders
This commit is contained in:
parent
a7342b600e
commit
7bf9768359
|
@ -94,11 +94,37 @@ function initMost() { /* {{{ */
|
|||
$(ev.currentTarget).datepicker('hide');
|
||||
});
|
||||
|
||||
$(".chzn-select").select2({
|
||||
$(".chzn-select").select2({ /* {{{ */
|
||||
width: '100%',
|
||||
templateResult: chzn_template_func//,
|
||||
//templateSelection: chzn_template_func
|
||||
});
|
||||
templateResult: chzn_template_func
|
||||
}); /* }}} */
|
||||
|
||||
$(".chzn-select-folder").select2({ /* {{{ */
|
||||
theme: "bootstrap4",
|
||||
width: 'resolve',
|
||||
debug: false,
|
||||
ajax: {
|
||||
url: seeddms_webroot+"op/op.Ajax.php",
|
||||
delay: 500,
|
||||
data: function (params) {
|
||||
var query = {
|
||||
query: params.term,
|
||||
command: 'searchfolder',
|
||||
format: 'select2'
|
||||
}
|
||||
// Query parameters will be ?search=[term]&command=folderlist
|
||||
return query;
|
||||
},
|
||||
processResults: function(data) {
|
||||
$.map(data.results, function (obj) {obj.text = obj.name || obj.text; obj.subtitle = obj.path || obj.subtitle; return obj; });
|
||||
return {
|
||||
results: data.results
|
||||
};
|
||||
},
|
||||
dataType: 'json'
|
||||
},
|
||||
templateResult: chzn_template_func
|
||||
}); /* }}} */
|
||||
|
||||
/* change the color and length of the bar graph showing the password
|
||||
* strength on each change to the passwod field.
|
||||
|
|
|
@ -96,12 +96,38 @@ function initMost() { /* {{{ */
|
|||
});
|
||||
*/
|
||||
|
||||
$(".chzn-select").select2({
|
||||
$(".chzn-select").select2({ /* {{{ */
|
||||
theme: "bootstrap4",
|
||||
width: 'resolve',
|
||||
templateResult: chzn_template_func//,
|
||||
//templateSelection: chzn_template_func
|
||||
});
|
||||
debug: false,
|
||||
templateResult: chzn_template_func
|
||||
}); /* }}} */
|
||||
|
||||
$(".chzn-select-folder").select2({ /* {{{ */
|
||||
theme: "bootstrap4",
|
||||
width: 'resolve',
|
||||
ajax: {
|
||||
url: seeddms_webroot+"op/op.Ajax.php",
|
||||
delay: 500,
|
||||
data: function (params) {
|
||||
var query = {
|
||||
query: params.term,
|
||||
command: 'searchfolder',
|
||||
format: 'select2'
|
||||
}
|
||||
// Query parameters will be ?search=[term]&command=folderlist
|
||||
return query;
|
||||
},
|
||||
processResults: function(data) {
|
||||
$.map(data.results, function (obj) {obj.text = obj.name || obj.text; obj.subtitle = obj.path || obj.subtitle; return obj; });
|
||||
return {
|
||||
results: data.results
|
||||
};
|
||||
},
|
||||
dataType: 'json'
|
||||
},
|
||||
templateResult: chzn_template_func
|
||||
}); /* }}} */
|
||||
|
||||
/* change the color and length of the bar graph showing the password
|
||||
* strength on each change to the passwod field.
|
||||
|
|
Loading…
Reference in New Issue
Block a user