Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aLFED-0006g1-4Z for pgadmin-hackers@arkaria.postgresql.org; Mon, 18 Jan 2016 19:12:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aLFEC-0004pu-NP for pgadmin-hackers@arkaria.postgresql.org; Mon, 18 Jan 2016 19:12:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aLFEC-0004po-Dw for pgadmin-hackers@postgresql.org; Mon, 18 Jan 2016 19:12:36 +0000 Received: from mail-ob0-x229.google.com ([2607:f8b0:4003:c01::229]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aLFE8-0007cu-JY for pgadmin-hackers@postgresql.org; Mon, 18 Jan 2016 19:12:35 +0000 Received: by mail-ob0-x229.google.com with SMTP id ba1so580392050obb.3 for ; Mon, 18 Jan 2016 11:12:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=oRGCXR2pXRio00NE975ZR13qgwprEjU1EWqujzHdRWE=; b=Ft5Abl7RNXbPLFmAb8CbfG7XszZ2O1AX4WpE24oGt4Ywg0z0NoQfNeEbQ+GlTiShdW dVFps0OjdwicIw5J3uwRcsa7YJhurK962kJQiCUcBMnIv+yGv1PRPFdQkMJCu33EKmuM SzpcHHWyjt++ddvzbSjDbowhpwq4wFLXEkRgquEt+bAimdk/CbuI5zvdCP2YegwZcJzv jSrw1TR0dVNjEaoROSEMavc/QBi0I7/0tn6Fh4cDFBnzwRg1+iHnnEzW9QFPyOjIhPax r2YpNioxVdW2qDV7C/gjRDILYq4ZgmPj3NKKuW/diXK2RpMuHgamt6ZQ8j59KZKIOjLO l71g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=oRGCXR2pXRio00NE975ZR13qgwprEjU1EWqujzHdRWE=; b=CDi/mK0S8d0pfed6jOgVKeQUBGoJne/IQr1sBgHbnRMlIm2nIJl8CJv9gukht5+CDv yPfF1CoOucEom+dXuG2bkUNJCd17Yw+xVegIiJRpw/Fh25/j4U/49Btm7aow4IPOj2Hd rZ4IcpYE42ngsUeauadnUB1+IY+E1DG11sHSsThrIdKzCl85CaJSYt4pyYXNcNWUqT+i akcZf7Loaf72ckTWKc4qeINMY9GJBbIW21PrdhKfgiPfnZXeJuNE+nDxgMQ8y0fWVjgi yXsijAT+dec2caQ/zoc7z8jg8I7JmRMh/gIv7eleSWcMK1wqnWsYMce6eEHqYQ1vEmTY JwZQ== X-Gm-Message-State: ALoCoQnJjIZsPOIxWPAXdqKNOfEezQeo3Qo/Dwj+NGivBc5q/GM8EOGZ6YQJEpvlJmlPXjAJcz8k83Bd/bCiutJTJSYd+w89we2/jFOFwNvl7KvLa0JYBI4= MIME-Version: 1.0 X-Received: by 10.60.74.100 with SMTP id s4mr20854409oev.36.1453144350300; Mon, 18 Jan 2016 11:12:30 -0800 (PST) Received: by 10.202.73.71 with HTTP; Mon, 18 Jan 2016 11:12:30 -0800 (PST) In-Reply-To: References: Date: Tue, 19 Jan 2016 00:42:30 +0530 Message-ID: Subject: Re: New mechanism in backgrid to render different types of cells in same column [pgAdmin4] From: Harshal Dhumal To: pgadmin-hackers@postgresql.org Content-Type: multipart/alternative; boundary=001a1135e1d8ceb2fd0529a08832 X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org --001a1135e1d8ceb2fd0529a08832 Content-Type: text/plain; charset=UTF-8 + Also fixed some minor issues related to Unique column functionality in Variable control in same patch. -- *Harshal Dhumal* *Software Engineer * EenterpriseDB On Tue, Jan 19, 2016 at 12:37 AM, Harshal Dhumal < harshal.dhumal@enterprisedb.com> wrote: > 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 > --001a1135e1d8ceb2fd0529a08832 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
+
Also fixed some minor issues related to Unique column= functionality in Variable control in same patch.

--=C2=A0
Harshal Dhumal
Software Engineer=C2=A0


=

On Tue, Jan 19, 2016 at 12:37 AM, Harshal Dh= umal <harshal.dhumal@enterprisedb.com> wrote:<= br>
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 arg= ument.

eg.:

schema: [
{id: 'name&= #39;, label:'Name', type:'text', edit= able: false, cell: 'string= '},
{
id: 'value&= #39;, label:'Value', type: 'text', ed= itable: true,
cellFunct= ion: function(model){

= if (isNaN(model.get(this.get('name')))) { return "string";
} else
{
return Backgrid.NumberCell;
} }
},
{id: 'database', label:'Database', type: &#= 39;text', editable: false<= /span>},
.
.
.


--=C2=A0
Harshal Dhumal
Software Engi= neer=C2=A0




--001a1135e1d8ceb2fd0529a08832--