git-svn-id: https://msi/svn/firstRepo/Management/trunk@32 0f545695-f87b-41b6-9a03-7f16563b5454

This commit is contained in:
2015-02-25 20:10:52 +00:00
parent 00cd1a3a61
commit 4b9fa8baa4
90 changed files with 443 additions and 4495 deletions
+23 -7
View File
@@ -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);
};
@@ -38,10 +38,12 @@
</table>
</div>
<div>
<input id="add" style="margin-right: 1%;" type="button" value="Aggiungi Ingrediente"/>
<input id="add" style="margin-right: 1%;" type="button" value="Aggiungi"/>
<input id="modify" type="button" value="Modifica"/>
<input id="remove" type="button" value="Cancella"/>
<input id="up" style="margin-right: 1%;" type="button" value="Up"/>
<input id="down" style="margin-right: 1%;" type="button" value="Down"/>
<input id="remove" type="button" value="Cancella Ingrediente"/>
<div style="border: none;" id="listbox"></div>
</div>
<div><textarea id="procedimento"></textarea></div>