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

This commit is contained in:
2016-03-01 14:20:31 +00:00
parent 1694a623ba
commit 9e22467a0a
2 changed files with 28 additions and 2 deletions
+27 -1
View File
@@ -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 "<div style='margin: 4px;' class='jqx-center-align'>" + valueBool + "</div>";
}
},
{text: 'Cover', editable: false, dataField: 'bCover', width: "70px",
cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) {
var valueBool = rowdata.bCover;
return "<div style='margin: 4px;' class='jqx-center-align'>" + valueBool + "</div>";
}
},
{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";