From 9e22467a0a676ce47ee7980fd47358530269a6d0 Mon Sep 17 00:00:00 2001 From: hexstudy Date: Tue, 1 Mar 2016 14:20:31 +0000 Subject: [PATCH] git-svn-id: https://msi/svn/firstRepo/Management/trunk@71 0f545695-f87b-41b6-9a03-7f16563b5454 --- js/manifest.js | 2 +- js/modules/editricetta/editricetta.js | 28 ++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/js/manifest.js b/js/manifest.js index 3891a7f..2e5cd31 100644 --- a/js/manifest.js +++ b/js/manifest.js @@ -1,7 +1,7 @@ var myManifest = { Debug: (window.location.port !== ""), Name: "Il Management", - Version: "0.3.2.0", + Version: "0.3.3.0", Author: "Denis Ironi", Settings: { DefaultURL: (window.location.port === "" ? "http://" + window.location.host + "/Service": "http://" + window.location.hostname + ":" + window.location.port + "/Service_Manut"), diff --git a/js/modules/editricetta/editricetta.js b/js/modules/editricetta/editricetta.js index 736671f..075eceb 100644 --- a/js/modules/editricetta/editricetta.js +++ b/js/modules/editricetta/editricetta.js @@ -44,7 +44,8 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/editricetta/editricett {name: 'from_profile_id', type: 'string'}, {name: 'uploaded_date', type: 'datetime'}, {name: 'profile_name', type: 'string'}, - {name: 'published', type: 'bool'} + {name: 'published', type: 'bool'}, + {name: 'bCover', type: 'bool'} ]; var photoAdapter = new $.jqx.dataAdapter({ datatype: "jsonp", @@ -423,6 +424,12 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/editricetta/editricett return "
" + valueBool + "
"; } }, + {text: 'Cover', editable: false, dataField: 'bCover', width: "70px", + cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { + var valueBool = rowdata.bCover; + return "
" + valueBool + "
"; + } + }, {text: '', datafield: 'FullView', columntype: 'button', width: '10%', cellsrenderer: function() { return "View Full"; @@ -453,6 +460,25 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/editricetta/editricett } } }, + {text: '', datafield: 'Cover', columntype: 'button', width: '10%', + cellsrenderer: function() { + return "Copertina"; + }, + buttonclick: function(row) { + var items = $("#gridPhotos").jqxGrid('source'); + var item = items.records[row]; + if(item.bCover === false) + { + $.ajax({ + url: myManifest.Settings.DefaultURL + "/backend/photo/set_cover/" + item.id_photo, + //dataType: "json", + type: 'GET' + }).then(function (response) { + $("#gridPhotos").jqxGrid('updatebounddata'); + }); + } + } + }, {text: '', datafield: 'Cancella', columntype: 'button', width: '10%', cellsrenderer: function() { return "Cancella";