jqgrid_utils 1.40.6 → 1.42.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/README.md CHANGED
@@ -150,7 +150,7 @@ A module for Jqgrid_utils
150
150
  * [module.exports#grid_ratio_on(grid, fraction_col, denominator_col, ratio_col)](#exp_module_Jqgrid_utils--module.exports+grid_ratio_on) ⏏
151
151
  * [module.exports#is_html(str)](#exp_module_Jqgrid_utils--module.exports+is_html) ⇒ <code>boolean</code> ⏏
152
152
  * [module.exports#_grid_sum_on()](#exp_module_Jqgrid_utils--module.exports+_grid_sum_on) ⏏
153
- * [module.exports#grid_sum_on(grid, fields, format, exclude)](#exp_module_Jqgrid_utils--module.exports+grid_sum_on) ⏏
153
+ * [module.exports#grid_sum_on(grid, fields, format, exclude, unique)](#exp_module_Jqgrid_utils--module.exports+grid_sum_on) ⏏
154
154
  * [module.exports#_grid_avg_on()](#exp_module_Jqgrid_utils--module.exports+_grid_avg_on) ⏏
155
155
  * [module.exports#grid_avg_on(grid, fields)](#exp_module_Jqgrid_utils--module.exports+grid_avg_on) ⏏
156
156
  * [module.exports#_grid_percent_on()](#exp_module_Jqgrid_utils--module.exports+_grid_percent_on) ⏏
@@ -164,6 +164,7 @@ A module for Jqgrid_utils
164
164
  * [module.exports#binary_replace(cell_value, a, b)](#exp_module_Jqgrid_utils--module.exports+binary_replace) ⏏
165
165
  * [module.exports#_date112_to_DMY(cell_value, seperator)](#exp_module_Jqgrid_utils--module.exports+_date112_to_DMY) ⏏
166
166
  * [module.exports#date112_to_DMY(col_model, edit_field, seperator)](#exp_module_Jqgrid_utils--module.exports+date112_to_DMY) ⏏
167
+ * [module.exports#set_col_model(col_model, edit_field, key, value)](#exp_module_Jqgrid_utils--module.exports+set_col_model) ⏏
167
168
  * [module.exports#add_formatter(col_model, edit_field, formatter)](#exp_module_Jqgrid_utils--module.exports+add_formatter) ⏏
168
169
  * [module.exports#natural_sort(col_model, column_name)](#exp_module_Jqgrid_utils--module.exports+natural_sort) ⇒ <code>array</code> ⏏
169
170
  * [module.exports#add_html_formatter(col_model, edit_field, html)](#exp_module_Jqgrid_utils--module.exports+add_html_formatter) ⇒ <code>array</code> ⏏
@@ -357,7 +358,7 @@ Syncron Alias grid_sum_on
357
358
  **Kind**: Exported function
358
359
  <a name="exp_module_Jqgrid_utils--module.exports+grid_sum_on"></a>
359
360
 
360
- ### module.exports#grid\_sum\_on(grid, fields, format, exclude) ⏏
361
+ ### module.exports#grid\_sum\_on(grid, fields, format, exclude, unique) ⏏
361
362
  Sum the columns values together
362
363
 
363
364
  **Kind**: Exported function
@@ -368,6 +369,7 @@ Sum the columns values together
368
369
  | fields | <code>string</code> | Column/Field Name to sum |
369
370
  | format | <code>string</code> | format, currency sign |
370
371
  | exclude | <code>array</code> | exclude, array of column field key:value object, example [{"user": "foo"}] - it excludes user with value foo |
372
+ | unique | <code>string</code> | unique, sum only unique from this column |
371
373
 
372
374
  **Example**
373
375
  ```js
@@ -380,7 +382,8 @@ gridComplete: function () {
380
382
  "wait_icollect",
381
383
  ]
382
384
  "$",
383
- [{user:"foo",country:"None"}]
385
+ [{user:"foo",country:"None"}],
386
+ "column_name_customer"
384
387
  );
385
388
  },
386
389
  ```
@@ -655,6 +658,30 @@ var jqu = new Jqgrid_utils();
655
658
  let _data = await jqu.date112_to_DMY(this,'field','/');
656
659
  console.log(_data);
657
660
  ```
661
+ <a name="exp_module_Jqgrid_utils--module.exports+set_col_model"></a>
662
+
663
+ ### module.exports#set\_col\_model(col_model, edit_field, key, value) ⏏
664
+ Set col_model
665
+
666
+ **Kind**: Exported function
667
+
668
+ | Param | Type | Description |
669
+ | --- | --- | --- |
670
+ | col_model | <code>array</code> | grid col_model |
671
+ | edit_field | <code>string</code> | string columns names what will be formatted |
672
+ | key | <code>string</code> | key of the model |
673
+ | value | <code>string</code> | value of the model |
674
+
675
+ **Example**
676
+ ```js
677
+ var jqu = new Jqgrid_utils();
678
+ col_model = await jqu.set_col_model(
679
+ col_model,
680
+ "to_close",
681
+ "editable",
682
+ true,
683
+ );
684
+ ```
658
685
  <a name="exp_module_Jqgrid_utils--module.exports+add_formatter"></a>
659
686
 
660
687
  ### module.exports#add\_formatter(col_model, edit_field, formatter) ⏏