jqgrid_utils 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/jqgrid_utils.js +25 -0
- package/jqgrid_utils.js +25 -0
- package/package.json +1 -1
package/dist/jqgrid_utils.js
CHANGED
|
@@ -101,7 +101,32 @@ var jqu = new Jqgrid_utils();
|
|
|
101
101
|
return col_model;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Replace a Binaery 0 or 1 to other given value
|
|
106
|
+
@alias module:Jqgrid_utils
|
|
107
|
+
@param {string} - cell value
|
|
108
|
+
@param {string} - string replacement for 0
|
|
109
|
+
@param {string} - string replacement for 1
|
|
110
|
+
@example
|
|
111
|
+
var jqu = new Jqgrid_utils();
|
|
112
|
+
let _data = jqu.binery_replace(0,'zero','one');
|
|
113
|
+
or for column formatter
|
|
114
|
+
download_formatter:"var jqu = new Jqgrid_utils();jqu.binary_replace({0},'zero','one')"});
|
|
115
|
+
*/
|
|
116
|
+
binary_replace(cell_value, a='zero',b='one')
|
|
117
|
+
{
|
|
118
|
+
let value = a;
|
|
119
|
+
if(cell_value == 1 || cell_value == 0 )
|
|
120
|
+
{
|
|
121
|
+
if(cell_value == 1)
|
|
122
|
+
{
|
|
123
|
+
value = b;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return value;
|
|
127
|
+
}
|
|
104
128
|
|
|
129
|
+
|
|
105
130
|
/**
|
|
106
131
|
* Convert a 112 date string to a DMY format with sepertaor - sync function
|
|
107
132
|
@alias module:Jqgrid_utils
|
package/jqgrid_utils.js
CHANGED
|
@@ -100,7 +100,32 @@ var jqu = new Jqgrid_utils();
|
|
|
100
100
|
return col_model;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Replace a Binaery 0 or 1 to other given value
|
|
105
|
+
@alias module:Jqgrid_utils
|
|
106
|
+
@param {string} - cell value
|
|
107
|
+
@param {string} - string replacement for 0
|
|
108
|
+
@param {string} - string replacement for 1
|
|
109
|
+
@example
|
|
110
|
+
var jqu = new Jqgrid_utils();
|
|
111
|
+
let _data = jqu.binery_replace(0,'zero','one');
|
|
112
|
+
or for column formatter
|
|
113
|
+
download_formatter:"var jqu = new Jqgrid_utils();jqu.binary_replace({0},'zero','one')"});
|
|
114
|
+
*/
|
|
115
|
+
binary_replace(cell_value, a='zero',b='one')
|
|
116
|
+
{
|
|
117
|
+
let value = a;
|
|
118
|
+
if(cell_value == 1 || cell_value == 0 )
|
|
119
|
+
{
|
|
120
|
+
if(cell_value == 1)
|
|
121
|
+
{
|
|
122
|
+
value = b;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return value;
|
|
126
|
+
}
|
|
103
127
|
|
|
128
|
+
|
|
104
129
|
/**
|
|
105
130
|
* Convert a 112 date string to a DMY format with sepertaor - sync function
|
|
106
131
|
@alias module:Jqgrid_utils
|
package/package.json
CHANGED