git-svn-id: https://msi/svn/firstRepo/Management/trunk@32 0f545695-f87b-41b6-9a03-7f16563b5454
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
define(['jquery', 'underscore', 'backbone', 'text!modules/editricetta/editricettaViewTemplate.html', 'modules/base/baseView',
|
||||
'controls/window/window', 'modules/addingr/addingr', 'jqxbuttons', 'jqxgrid', 'jqxcombobox', 'jqxdata', 'jqxdropdownlist',
|
||||
'jqxgrid', 'jqxgrid_selection', 'jqxgrid_columnsresize', 'jqxgrid_filter',
|
||||
'jqxtabs', 'jqxeditor', 'jqxinput', 'jqxrating', 'jqxnumberinput', 'jqxlistbox'],
|
||||
'controls/window/window', 'modules/addingr/addingr', 'jqx'],
|
||||
function($, _, Backbone, editricettaViewTemplate, BaseView, Window, AddIngrDlg) {
|
||||
|
||||
var EditRicetteView = BaseView.extend({
|
||||
@@ -152,8 +150,9 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/editricetta/editricett
|
||||
}
|
||||
else if (tab === 1)
|
||||
{
|
||||
$("#add").jqxButton({width: '37%'});
|
||||
$("#remove").jqxButton({disabled: true, width: '37%'});
|
||||
$("#add").jqxButton({width: '22%'});
|
||||
$("#remove").jqxButton({disabled: true, width: '22%'});
|
||||
$("#modify").jqxButton({disabled: true, width: '22%'});
|
||||
|
||||
$('#add').on('click', function() {
|
||||
self.addIngrDlg.openDlg();
|
||||
@@ -167,6 +166,15 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/editricetta/editricett
|
||||
|
||||
$("#listbox").jqxListBox('source', items);
|
||||
});
|
||||
|
||||
$('#modify').on('click', function() {
|
||||
var indexSelected = $('#listbox').jqxListBox('getSelectedIndex');
|
||||
|
||||
var items = $("#listbox").jqxListBox('source');
|
||||
var item = items[indexSelected];
|
||||
|
||||
self.addIngrDlg.openDlg(indexSelected, item);
|
||||
});
|
||||
|
||||
$("#up").jqxButton({disabled: true, width: '8%'});
|
||||
$("#down").jqxButton({disabled: true, width: '8%'});
|
||||
@@ -243,6 +251,7 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/editricetta/editricett
|
||||
$('#listbox').on('select', function(event) {
|
||||
var args = event.args;
|
||||
if (args) {
|
||||
$("#modify").jqxButton({disabled: false});
|
||||
$("#remove").jqxButton({disabled: false});
|
||||
if (args.index === 0)
|
||||
{
|
||||
@@ -265,6 +274,7 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/editricetta/editricett
|
||||
var args = event.args;
|
||||
if (args) {
|
||||
$("#remove").jqxButton({disabled: true});
|
||||
$("#modify").jqxButton({disabled: true});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -338,9 +348,15 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/editricetta/editricett
|
||||
|
||||
this.addIngrDlg.render();
|
||||
|
||||
this.addIngrDlg.addBtnFn = function(item) {
|
||||
this.addIngrDlg.addBtnFn = function(index, item) {
|
||||
var items = $("#listbox").jqxListBox('source');
|
||||
items.push(item);
|
||||
if(index === null){
|
||||
items.push(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
items.splice(index, 1, item);
|
||||
}
|
||||
$("#listbox").jqxListBox('source', items);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user