1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-19 20:00:29 +01:00

Aggiunta selezione tramite ID per funzione input

This commit is contained in:
Luca 2022-03-22 16:12:43 +01:00
parent a28ffe5b57
commit 97bcbed521
2 changed files with 8 additions and 3 deletions

View File

@ -86,9 +86,9 @@ $(document).ready(function(){
id_plugin: "'.$id_plugin.'",
}).then(function(response) {
// Selezione automatica nuovo valore per il select
var select = $("#'.get('select').'");
var select = input("'.get('select').'", 1);
if (select) {
select.selectSetNew(response.id, response.text, response.data);
select.getElement().selectSetNew(response.id, response.text, response.data);
//select.change();
}

View File

@ -25,7 +25,7 @@
* @param {string|jQuery|HTMLElement} name
* @returns {Input|*}
*/
function input(name) {
function input(name, use_id) {
let element;
// Selezione tramite jQuery
@ -38,6 +38,11 @@ function input(name) {
element = $(name);
}
// Selezione tramite ID
else if (use_id !== undefined) {
element = $("#" + name ).last();
}
// Selezione per nome
else {
element = $("[name='" + name + "']").last();