Skip to content
Snippets Groups Projects
Commit aa102e28 authored by Prasad's avatar Prasad
Browse files

Fixes #1077::Uma::Selected columns in reports is not keeping choosen order

parents 53f07b7c d3d2100f
No related branches found
No related tags found
No related merge requests found
......@@ -62,7 +62,7 @@ Vtiger_Detail_Js("Reports_Detail_Js",{},{
function(error,data){
app.helper.hideProgress();
thisInstance.getContentHolder().find('#reportContentsDiv').html(data);
if(currentMode == 'save') jQuery('.reportActionButtons').addClass('hide');
jQuery('.reportActionButtons').addClass('hide');
// app.helper.showHorizontalScroll(jQuery('#reportDetails'));
// To get total records count
......
......@@ -189,7 +189,7 @@ Reports_Edit_Js("Reports_Edit2_Js",{},{
*/
arrangeSelectChoicesInOrder : function() {
var selectElement = this.getReportsColumnsList();
var chosenElement = jQuery('#s2id_reportsColumnsList');
var chosenElement = app.getSelect2ElementFromSelect(selectElement);
var choicesContainer = chosenElement.find('ul.select2-choices');
var choicesList = choicesContainer.find('li.select2-search-choice');
......@@ -204,7 +204,9 @@ Reports_Edit_Js("Reports_Edit2_Js",{},{
}
for(var index=selectedOrderKeys.length ; index > 0 ; index--) {
var selectedValue = selectedOrder[selectedOrderKeys[index-1]];
var option = selectedOptions.filter('[value="'+selectedValue+'"]');
//We should consider value as string
var colonEscapedValue = selectedValue.replace(":", "\\:");
var option = selectedOptions.filter('[value="'+colonEscapedValue+'"]');
choicesList.each(function(choiceListIndex,element){
var liElement = jQuery(element);
if(liElement.find('div').html() == option.html()){
......@@ -302,12 +304,12 @@ Reports_Edit_Js("Reports_Edit2_Js",{},{
//If the container is reloading, containers cache should be reset
this.reportsColumnsList = false;
this.selectedFields = false;
this.arrangeSelectChoicesInOrder();
this.registerLineItemCalculationLimit();
this.registerLineItemCalculationLimitOnLoad();
vtUtils.applyFieldElementsView(container);
this.registerSelect2ElementForReportColumns();
this.makeColumnListSortable();
this.arrangeSelectChoicesInOrder();
this.makeColumnListSortable();
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment