51 lines
1.7 KiB
JavaScript
51 lines
1.7 KiB
JavaScript
|
|
//Cikkcsoport keresés
|
|
$( "#addItemGroup" ).click(function() {
|
|
|
|
var data= {content: $(itemGroup).val()};
|
|
// alert( "Handler for .click() called." );
|
|
$.ajax({
|
|
type: 'POST',
|
|
data: JSON.stringify(data),
|
|
contentType: "application/json",
|
|
dataType:'json',
|
|
url: '/components_base/addItemGroup',
|
|
success: function(data) {
|
|
if (data.result==='OK'){
|
|
console.log('success');
|
|
console.log(JSON.stringify(data));
|
|
var option=document.createElement("option");
|
|
option.id=data.id;
|
|
option.value=data.name;
|
|
|
|
$('#listItemGroups').add(option);
|
|
// $('#itemGroupName').val(data.data.)
|
|
/*$('#itemNumber').val(data.data.itemNumber);//=data.data[0].itemNumber;
|
|
$('#itemName').val(data.data.name);//=data.data[0].itemNumber;
|
|
$('#itemParams').val(data.data.parameters);//=data.data[0].itemNumber;
|
|
$('#saveandnew').prop('disabled', false);
|
|
$('#save').prop('disabled', false);
|
|
$('#itemSerial').select();*/
|
|
}
|
|
if (data.result==='Not Found')
|
|
{
|
|
//$('#saveandnew').prop('disabled', true);
|
|
// $('#save').prop('disabled', true);
|
|
// $('#ean').val('Nincs találat!').select();//=data.data[0].itemNumber;
|
|
//$('#ean').select();
|
|
}
|
|
},
|
|
error: function(error) {
|
|
console.log("some error in fetching the notifications");
|
|
}
|
|
|
|
}).done (function (data) {
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|