From: | Harshal Dhumal <harshal(dot)dhumal(at)enterprisedb(dot)com> |
---|---|
To: | pgadmin-hackers(at)postgresql(dot)org |
Subject: | New mechanism in backgrid to render different types of cells in same column [pgAdmin4] |
Date: | 2016-01-18 19:07:59 |
Message-ID: | CAFiP3vz0Q0rocpPcYVcHwu3MYWXWpzGUTOS3vVSC-XfLLM6aKg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-hackers |
Hi,
This patch is replacement for our developed DynamicVariablecell.
Now we can pass cellFunction in column schema to get appropriate cell class.
User provided cellFunction must return valid cell class.
cellFunction will be called with context (this) as column and model as
argument.
eg.:
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},
.
.
.
--
*Harshal Dhumal*
*Software Engineer *
EenterpriseDB <http://www.enterprisedb.com>
Attachment | Content-Type | Size |
---|---|---|
variable_js_19_Jan.patch | text/x-patch | 8.5 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Harshal Dhumal | 2016-01-18 19:12:30 | Re: New mechanism in backgrid to render different types of cells in same column [pgAdmin4] |
Previous Message | Neel Patel | 2016-01-18 16:47:04 | Re: [pgAdmin4] - Desktop runtime patch |