Thread: New mechanism in backgrid to render different types of cells in same column [pgAdmin4]
New mechanism in backgrid to render different types of cells in same column [pgAdmin4]
From
Harshal Dhumal
Date:
Hi,
This patch is replacement for our developed DynamicVariablecell.User provided cellFunction must return valid cell class.
cellFunction will be called with context (this) as column and model as argument.
schema: [
{id: 'name', label:'Name', type:'text', editable: false, cell: 'string'},
{
id: 'value', label:'Value', type: 'text', editable: true,
cellFunction: function(model){
if (isNaN(model.get(this.get('name')))) {
return "string";
} else {
return Backgrid.NumberCell;
}
}
},
{id: 'database', label:'Database', type: 'text', editable: false},
.
.
.
Attachment
Re: New mechanism in backgrid to render different types of cells in same column [pgAdmin4]
From
Harshal Dhumal
Date:
+
Also fixed some minor issues related to Unique column functionality in Variable control in same patch.
Also fixed some minor issues related to Unique column functionality in Variable control in same patch.
On Tue, Jan 19, 2016 at 12:37 AM, Harshal Dhumal <harshal.dhumal@enterprisedb.com> wrote:
eg.:Now we can pass cellFunction in column schema to get appropriate cell class.Hi,This patch is replacement for our developed DynamicVariablecell.
User provided cellFunction must return valid cell class.
cellFunction will be called with context (this) as column and model as argument.schema: [
{id: 'name', label:'Name', type:'text', editable: false, cell: 'string'},
{
id: 'value', label:'Value', type: 'text', editable: true,
cellFunction: function(model){
if (isNaN(model.get(this.get('name')))) {
return "string";
} else {
return Backgrid.NumberCell;
}
}
},
{id: 'database', label:'Database', type: 'text', editable: false},
.
.
.
Re: New mechanism in backgrid to render different types of cells in same column [pgAdmin4]
From
Ashesh Vashi
Date:
On Fri, Feb 5, 2016 at 2:16 PM, Harshal Dhumal <harshal.dhumal@enterprisedb.com> wrote:
Hi, Ashesh,
Hi Harshal,
[ Please do not forget to reply to All next time.. :-) ]
Same patch which I send on 19 Jan with very minor change. i.e. properly initialize bool cell for dynamic variable cell.
Thanks - I've committed the patch.
On Tue, Jan 19, 2016 at 12:42 AM, Harshal Dhumal <harshal.dhumal@enterprisedb.com> wrote:+
Also fixed some minor issues related to Unique column functionality in Variable control in same patch.On Tue, Jan 19, 2016 at 12:37 AM, Harshal Dhumal <harshal.dhumal@enterprisedb.com> wrote:eg.:Now we can pass cellFunction in column schema to get appropriate cell class.Hi,This patch is replacement for our developed DynamicVariablecell.
User provided cellFunction must return valid cell class.
cellFunction will be called with context (this) as column and model as argument.schema: [
{id: 'name', label:'Name', type:'text', editable: false, cell: 'string'},
{
id: 'value', label:'Value', type: 'text', editable: true,
cellFunction: function(model){
if (isNaN(model.get(this.get('name')))) {
return "string";
} else {
return Backgrid.NumberCell;
}
}
},
{id: 'database', label:'Database', type: 'text', editable: false},
.
.
.