Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - paramvir

Pages: [1] 2 3 ... 371
1
class of the selection overlay is "pq-grid-overlay r11c12r21c23" so you can add the style according to the selected area.

class r11c12r21c23 implies r1: 1, c1: 2, r2: 1, c2: 3

2
Help for ParamQuery Pro / Re: about selectionModel's block
« on: July 01, 2022, 12:07:14 pm »
There is no beforeSelectChange event but the selection can be adjusted in selectEnd event as per your requirement.

Code: [Select]
selectEnd: function(evt, ui){
debugger;
var address = ui.selection.address()[0];
this.Range({r1: address.r1, c1: address.c1, rc:1, cc: address.cc}).select();
}

3
Help for ParamQuery Pro / Re: Change ExcelSheet Cell Color
« on: June 30, 2022, 04:49:29 pm »
The code runs in browser and it has nothing to do with local or production environment.

BTW this example https://paramquery.com/pro/demos/import-xlsx is also running in production environment.

4
1. issue is not clear.

2. Make changes in rowTemplate getter and setter according to the structure of data.

Code: [Select]
get() {
  ....
  return this.custom_fields[_indx].userData[0];
},
set(val) {
  this.custom_fields[_indx].userData = [val]; 
}

Ensure to turn on tracking and add primary key i.e., dataModel.recIndx similar to this example:

https://paramquery.com/pro/demos/editing_batch

5
Help for ParamQuery Pro / Re: Remove + Tab button In Excel Sheet
« on: June 30, 2022, 11:27:46 am »
Add noAdd: true to tabModel.

https://paramquery.com/pro/api#option-tabModel

Code: [Select]
        tabModel: {
    noAdd: true,
            tabs: []
        },

6
Help for ParamQuery Pro / Re: Change ExcelSheet Cell Color
« on: June 29, 2022, 08:10:03 pm »
Please share a jsfiddle.

7
Help for ParamQuery Pro / Re: Change ExcelSheet Cell Color
« on: June 29, 2022, 01:16:31 pm »
it would be the same code inside the copy event

Code: [Select]
copy: function(){
  this.Selection().style('background-color', "#ff0099" );
}

8
Your file url is not accessible. Please send the file to support at paramquery.com

9
Help for ParamQuery Pro / Re: Change ExcelSheet Cell Color
« on: June 28, 2022, 07:38:09 pm »

Code: [Select]
  this.Selection().style('background-color', "#ff0099" );

Example: https://paramquery.com/pro/demos/import-xlsx there is colopicker in the toolbar of this example which uses the same pqgrid API to change color.

10
Suggest new features / Re: Default value in colModel
« on: June 28, 2022, 12:30:14 pm »
you don't need to work with the code. That code purpose is to add support for defaultValue property in the columns.

11
Please add mode: 'OR' to filter method.

Code: [Select]
this.filter({
oper: 'replace',
        mode: 'OR",
rules: filterRules
})

Reference: https://paramquery.com/pro/api#method-filter

12
Help for ParamQuery Pro / Re: SortType parameters
« on: June 27, 2022, 06:17:35 am »
dataType and sort direction parameters are not passed to sortType function.

However they can be obtained with this code inside the sortType callback function.

Code: [Select]
var dataType = grid.getColumn({dataIndx: dataIndx}).dataType || "string";
var dir = grid.option('sortModel').sorter.find(col=>col.dataIndx==dataIndx).dir

where grid is js grid instance of the grid.

13
Suggest new features / Re: Default value in colModel
« on: June 24, 2022, 04:32:04 am »
Your requirement can be met by adding this code in the grid initialization object.

Code: [Select]
rowTemplate: {},
complete: function(){
var rt = this.option('rowTemplate'), cm = this.getColModel();
//debugger;
cm.forEach(function(col){
var def = col.defaultValue, di = col.dataIndx;
if( def !== undefined ){
Object.defineProperty(rt, di, {
enumerable: true,
get(){
var val = this[ "_" + di];
return val == null? def: val;;
},
set(val){
this[ "_" + di ] = val;
}
});
}
});
},

and use defaultValue instead if default since default is a reserved word.

14
1. Add configurable: true to the Object.defineProperty as shown in the updated example. https://paramquery.com/pro/demos/dynamic_columns

2. Turn on the tracking. trackModel: { on: true }, //to turn on the track changes.  and add dataModel.recIndx similar to this example:

https://paramquery.com/pro/demos/editing_batch

3. updateList contains values in both plain and nested format when format: 'raw' is passed to getChanges method.

https://paramquery.com/pro/api#method-getChanges

15
Please use this filter definition ( with required changes ) for firstname column.

Code: [Select]
                filter: { crules: [{condition: 'contain' }], listener: function(evt, ui){
debugger;
var filterRules = [{ dataIndx: 'firstname', condition: 'contain', value: ui.value},
{ dataIndx: 'lastname', condition: 'contain', value: ui.value}];
this.filter({
oper: 'replace',
rules: filterRules
});
}}

Pages: [1] 2 3 ... 371