BUG 10084 I added a functionality to save order the dashlet SOLVED
I added a functionality to save order the dashlet
This commit is contained in:
@@ -105,9 +105,9 @@ class Dashboard extends Controller
|
||||
{
|
||||
$this->setResponseType( 'json' );
|
||||
try {
|
||||
$orderDashlet[0] = json_decode($data->postionCol0);
|
||||
$orderDashlet[1] = json_decode($data->postionCol1);
|
||||
$orderDashlet[2] = json_decode($data->postionCol2);
|
||||
$orderDashlet[0] = Bootstrap::json_encode($data->positionCol0);
|
||||
$orderDashlet[1] = Bootstrap::json_encode($data->positionCol1);
|
||||
$orderDashlet[2] = Bootstrap::json_encode($data->positionCol2);
|
||||
|
||||
G::loadClass('configuration');
|
||||
$oConfiguration = new Configurations();
|
||||
@@ -119,7 +119,7 @@ class Dashboard extends Controller
|
||||
$dataNow['ORDER'] = $orderDashlet;
|
||||
|
||||
if (isset($data->columns)) {
|
||||
$dataNow['COLUMNS'] = json_decode($data->columns);
|
||||
$dataNow['COLUMNS'] = Bootstrap::json_encode($data->columns);
|
||||
}
|
||||
|
||||
$dataDashboard = array_merge($dataDashboard, $dataNow);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
function generatedOrder () {
|
||||
var orderNow = new Array();
|
||||
orderNow[0] = new Array();
|
||||
orderNow[1] = new Array();
|
||||
orderNow[2] = new Array();
|
||||
var orderNow = [];;
|
||||
orderNow[0] = [];
|
||||
orderNow[1] = [];
|
||||
orderNow[2] = [];
|
||||
|
||||
for (var i = 0; i < Ext.getCmp('columnPos0').items.items.length; i++) {
|
||||
orderNow[0][i] = Ext.getCmp('columnPos0').items.items[i].dasInsUid;
|
||||
@@ -43,7 +43,6 @@ Ext.onReady(function(){
|
||||
handler : function(a) {
|
||||
Ext.MessageBox.show({
|
||||
msg: _('ID_LOADING'),
|
||||
progressText: 'Saving...',
|
||||
width:300,
|
||||
wait:true,
|
||||
waitConfig: {interval:200},
|
||||
@@ -64,20 +63,20 @@ Ext.onReady(function(){
|
||||
var orderNow = generatedOrder();
|
||||
Ext.Ajax.request({
|
||||
params: {
|
||||
postionCol0: Ext.encode(orderNow[0]),
|
||||
postionCol1: Ext.encode(orderNow[1]),
|
||||
postionCol2: Ext.encode(orderNow[2]),
|
||||
positionCol0: Ext.encode(orderNow[0]),
|
||||
positionCol1: Ext.encode(orderNow[1]),
|
||||
positionCol2: Ext.encode(orderNow[2]),
|
||||
columns: 3
|
||||
},
|
||||
url: 'dashboard/saveOrderDashlet',
|
||||
success: function (retorno) {
|
||||
var data = Ext.decode(retorno.responseText);
|
||||
success: function (res) {
|
||||
var data = Ext.decode(res.responseText);
|
||||
if (data.success) {
|
||||
Ext.MessageBox.hide();
|
||||
}
|
||||
},
|
||||
failure: function () {
|
||||
Ext.MessageBox.alert('Error', 'Error al Guardar');
|
||||
Ext.MessageBox.alert(_('ID_ERROR'), _('ID_IMPORTING_ERROR');
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -123,20 +122,20 @@ Ext.onReady(function(){
|
||||
var orderNow = generatedOrder();
|
||||
Ext.Ajax.request({
|
||||
params: {
|
||||
postionCol0: Ext.encode(orderNow[0]),
|
||||
postionCol1: Ext.encode(orderNow[1]),
|
||||
postionCol2: Ext.encode(orderNow[2]),
|
||||
positionCol0: Ext.encode(orderNow[0]),
|
||||
positionCol1: Ext.encode(orderNow[1]),
|
||||
positionCol2: Ext.encode(orderNow[2]),
|
||||
columns: 2
|
||||
},
|
||||
url: 'dashboard/saveOrderDashlet',
|
||||
success: function (retorno) {
|
||||
var data = Ext.decode(retorno.responseText);
|
||||
success: function (res) {
|
||||
var data = Ext.decode(res.responseText);
|
||||
if (data.success) {
|
||||
Ext.MessageBox.hide();
|
||||
}
|
||||
},
|
||||
failure: function () {
|
||||
Ext.MessageBox.alert('Error', 'Error al Guardar');
|
||||
Ext.MessageBox.alert(_('ID_ERROR'), _('ID_IMPORTING_ERROR');
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -190,20 +189,20 @@ Ext.onReady(function(){
|
||||
}
|
||||
Ext.Ajax.request({
|
||||
params: {
|
||||
postionCol0: Ext.encode(orderNow[0]),
|
||||
postionCol1: Ext.encode(orderNow[1]),
|
||||
postionCol2: Ext.encode(orderNow[2]),
|
||||
positionCol0: Ext.encode(orderNow[0]),
|
||||
positionCol1: Ext.encode(orderNow[1]),
|
||||
positionCol2: Ext.encode(orderNow[2]),
|
||||
columns: colum
|
||||
},
|
||||
url: 'dashboard/saveOrderDashlet',
|
||||
success: function (retorno) {
|
||||
var data = Ext.decode(retorno.responseText);
|
||||
success: function (res) {
|
||||
var data = Ext.decode(res.responseText);
|
||||
if (data.success) {
|
||||
Ext.MessageBox.hide();
|
||||
}
|
||||
},
|
||||
failure: function () {
|
||||
Ext.MessageBox.alert('Error', 'Error al Guardar');
|
||||
Ext.MessageBox.alert(_('ID_ERROR'), _('ID_IMPORTING_ERROR');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user