mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-10-19 23:11:44 -04:00
Persist column visbility per user and per module (#563)
This commit is contained in:
1 parent
fc2d5e89f0
commit
ea77980bff
6 files changed
+39
-6
No files matched your search
@@ -34,6 +34,7 @@ $(document).ready(function()
|
||||
<?php $this->load->view('partial/bootstrap_tables_locale'); ?>
|
||||
|
||||
table_support.init({
|
||||
employee_id: <?php echo $this->Employee->get_logged_in_employee_info()->person_id; ?>,
|
||||
resource: '<?php echo site_url($controller_name);?>',
|
||||
headers: <?php echo $table_headers; ?>,
|
||||
pageSize: <?php echo $this->config->item('lines_per_page'); ?>,
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="dist/opensourcepos.min.css?rel=fb16e96753"/>
|
||||
<!-- end mincss template tags -->
|
||||
<!-- start minjs template tags -->
|
||||
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=52c5b53668" language="javascript"></script>
|
||||
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=5caa0fe77d" language="javascript"></script>
|
||||
<!-- end minjs template tags -->
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
Vendored
+17
-1
@@ -44603,7 +44603,6 @@ THE SOFTWARE.*/
|
||||
message: (function() {
|
||||
var node = $('<div></div>');
|
||||
$.get($link.attr('href') || $link.data('href'), function(data) {
|
||||
console.log("getting data from " + ($link.attr('href') || $link.data('href')));
|
||||
node.html(data);
|
||||
});
|
||||
return node;
|
||||
@@ -44722,6 +44721,15 @@ THE SOFTWARE.*/
|
||||
|
||||
var options;
|
||||
|
||||
var toggle_column_visbility = function() {
|
||||
if (localStorage[options.employee_id]) {
|
||||
var user_settings = JSON.parse(localStorage[options.employee_id]);
|
||||
user_settings[options.resource] && $.each(user_settings[options.resource], function(index, element) {
|
||||
element ? table().showColumn(index) : table().hideColumn(index);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var init = function (_options) {
|
||||
options = _options;
|
||||
enable_actions = enable_actions(options.enableActions);
|
||||
@@ -44744,6 +44752,13 @@ THE SOFTWARE.*/
|
||||
onCheckAll: enable_actions,
|
||||
onUncheckAll: enable_actions,
|
||||
onLoadSuccess: load_success(options.onLoadSuccess),
|
||||
onColumnSwitch : function(field, checked) {
|
||||
var user_settings = localStorage[options.employee_id];
|
||||
user_settings = (user_settings && JSON.parse(user_settings)) || {};
|
||||
user_settings[options.resource] = user_settings[options.resource] || {};
|
||||
user_settings[options.resource][field] = checked;
|
||||
localStorage[options.employee_id] = JSON.stringify(user_settings);
|
||||
},
|
||||
queryParamsType: 'limit',
|
||||
iconSize: 'sm',
|
||||
silentSort: true,
|
||||
@@ -44751,6 +44766,7 @@ THE SOFTWARE.*/
|
||||
}));
|
||||
enable_actions();
|
||||
init_delete();
|
||||
toggle_column_visbility();
|
||||
};
|
||||
|
||||
var init_delete = function (confirmMessage) {
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long.
+17
-1
@@ -70,7 +70,6 @@
|
||||
message: (function() {
|
||||
var node = $('<div></div>');
|
||||
$.get($link.attr('href') || $link.data('href'), function(data) {
|
||||
console.log("getting data from " + ($link.attr('href') || $link.data('href')));
|
||||
node.html(data);
|
||||
});
|
||||
return node;
|
||||
@@ -189,6 +188,15 @@
|
||||
|
||||
var options;
|
||||
|
||||
var toggle_column_visbility = function() {
|
||||
if (localStorage[options.employee_id]) {
|
||||
var user_settings = JSON.parse(localStorage[options.employee_id]);
|
||||
user_settings[options.resource] && $.each(user_settings[options.resource], function(index, element) {
|
||||
element ? table().showColumn(index) : table().hideColumn(index);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var init = function (_options) {
|
||||
options = _options;
|
||||
enable_actions = enable_actions(options.enableActions);
|
||||
@@ -211,6 +219,13 @@
|
||||
onCheckAll: enable_actions,
|
||||
onUncheckAll: enable_actions,
|
||||
onLoadSuccess: load_success(options.onLoadSuccess),
|
||||
onColumnSwitch : function(field, checked) {
|
||||
var user_settings = localStorage[options.employee_id];
|
||||
user_settings = (user_settings && JSON.parse(user_settings)) || {};
|
||||
user_settings[options.resource] = user_settings[options.resource] || {};
|
||||
user_settings[options.resource][field] = checked;
|
||||
localStorage[options.employee_id] = JSON.stringify(user_settings);
|
||||
},
|
||||
queryParamsType: 'limit',
|
||||
iconSize: 'sm',
|
||||
silentSort: true,
|
||||
@@ -218,6 +233,7 @@
|
||||
}));
|
||||
enable_actions();
|
||||
init_delete();
|
||||
toggle_column_visbility();
|
||||
};
|
||||
|
||||
var init_delete = function (confirmMessage) {
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<!-- end mincss template tags -->
|
||||
<link rel="stylesheet" type="text/css" href="templates/spacelab/css/style.css"/>
|
||||
<!-- start minjs template tags -->
|
||||
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=52c5b53668" language="javascript"></script>
|
||||
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=5caa0fe77d" language="javascript"></script>
|
||||
<!-- end minjs template tags -->
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
Reference in new issue
Block a user