New mechanism in backgrid to render different types of cells in same column [pgAdmin4] - Mailing list pgadmin-hackers

From Harshal Dhumal
Subject New mechanism in backgrid to render different types of cells in same column [pgAdmin4]
Date
Msg-id CAFiP3vz0Q0rocpPcYVcHwu3MYWXWpzGUTOS3vVSC-XfLLM6aKg@mail.gmail.com
Whole thread Raw
Responses Re: New mechanism in backgrid to render different types of cells in same column [pgAdmin4]
List 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 



Attachment

pgadmin-hackers by date:

Previous
From: Neel Patel
Date:
Subject: Re: [pgadmin-support] [pgAdmin4] - Desktop runtime patch
Next
From: Harshal Dhumal
Date:
Subject: Re: New mechanism in backgrid to render different types of cells in same column [pgAdmin4]