Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1anjSS-0000gq-8M for pgadmin-hackers@arkaria.postgresql.org; Wed, 06 Apr 2016 09:09:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1anjSR-0007wT-Qz for pgadmin-hackers@arkaria.postgresql.org; Wed, 06 Apr 2016 09:09:03 +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_2) (envelope-from ) id 1anjSR-0007wN-8N for pgadmin-hackers@postgresql.org; Wed, 06 Apr 2016 09:09:03 +0000 Received: from mail-ig0-x22d.google.com ([2607:f8b0:4001:c05::22d]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1anjSM-0004bh-Sa for pgadmin-hackers@postgresql.org; Wed, 06 Apr 2016 09:09:02 +0000 Received: by mail-ig0-x22d.google.com with SMTP id ui10so36591937igc.1 for ; Wed, 06 Apr 2016 02:08:58 -0700 (PDT) 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:from:date:message-id:subject:to :cc; bh=wQ/v4qhuc9+8OXOjGb/BeBGtXbD9nfQvsuippeBjfhs=; b=s2HoK/8eB6Y20YNZoaC/tzDJ2Yb6RXEkkGQ5EupT5lX2UtBc+My2fRWneYVkmqCuSY G9/0uvkXD6VAbtCGM6FDNpt8oiYYn9DzdIHtl2Zq010bocjioAFGJ3PQzDnX7QoMpj+4 suRPKwh+atPdL0f5d9QSCusJq8Jz3bNcxljK17YebD5ePkIxffnWNWp42TwQ8+VIFegv fSGW6pgygV2lGAaswuWh2DfHw8nxS0evhX6JjoDVMP2ABHdebiP7vakBMjmiC/YCcpvH /2HLYywBlydNNhMMcpnC1KTvPmuYtrxELEorPCrH8/bADvGBmIWsFQCNchXZgui7IT5/ Vzqg== 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:from:date :message-id:subject:to:cc; bh=wQ/v4qhuc9+8OXOjGb/BeBGtXbD9nfQvsuippeBjfhs=; b=MHSXWmPIkVBDIFwkStqHymakyCD5/H0rFnEpjJ2A2YDCI48kleKi7oxiuXGgOrLCeA RJK8bZQMPUSPyidVJ0aoQdPPUeVzlzsrs0Z8ZIXeoYwnoZUijisxJrjNj6KEnLn50gAe AJHj7Nzo+xh7sxhXvREb1V3JUZc54EtYQHWQ140huBSNkgptcDTmpH4cbmfU9uQJYrUR rAHs3WA8Xf4nJmyABMRDOmSJhm7lO6wNFsdg9svUORrOwIR5vI3t+JimcjudrXP1FrlD zUAt5Ugmy8WrRUXwlmIsUu25/aWtAsEMdfCcHr+s5W7ibFt+3iAyG17cx/Di5TrCgvl7 6Wow== X-Gm-Message-State: AD7BkJIQpch8aOoMH9kgKQtWdeQGbVygRs0RLJi4GpTlLBsLiRuMl2o0oX3faWk+5BKGwHQ1G5kNHz5Suy2s1YKv X-Received: by 10.50.143.102 with SMTP id sd6mr15570609igb.73.1459933736978; Wed, 06 Apr 2016 02:08:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.39.5 with HTTP; Wed, 6 Apr 2016 02:08:37 -0700 (PDT) In-Reply-To: References: From: Ashesh Vashi Date: Wed, 6 Apr 2016 14:38:37 +0530 Message-ID: Subject: Re: [pgAdmin4][Patch]: Backgrid StringDepsCell To: Khushboo Vashi Cc: pgadmin-hackers Content-Type: multipart/mixed; boundary=001a1135e456ca8c81052fcd4fd8 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 --001a1135e456ca8c81052fcd4fd8 Content-Type: multipart/alternative; boundary=001a1135e456ca8c7c052fcd4fd6 --001a1135e456ca8c7c052fcd4fd6 Content-Type: text/plain; charset=UTF-8 Hi Khushboo, On Tue, Apr 5, 2016 at 10:59 AM, Khushboo Vashi < khushboo.vashi@enterprisedb.com> wrote: > Hi Ashesh, > > I have changed the function name (from *render_deps* to *updateUIDeps*), > which will be called on the dependent field change, as per your suggestion. > I've updated the patch. Please try this. I think - 'updateUIDeps' is not the write name. A Cell can do anything, when dependent changed, hence - I renamed it with 'dependentChanged'. Also, The user is not going to extend existing cell from the DependendsCell, but - only going to use the functions. Hence - I have created a separate class for it instead of extend it from Backgrid.Cell. -- Thanks & Regards, Ashesh Vashi EnterpriseDB INDIA: Enterprise PostgreSQL Company *http://www.linkedin.com/in/asheshvashi* > > Please find attached patch for the same. > > Thanks, > Khushboo > > On Fri, Apr 1, 2016 at 3:56 PM, Khushboo Vashi < > khushboo.vashi@enterprisedb.com> wrote: > >> Hi Ashesh, >> >> Yes, agreed. This implementation limits us to use only String Cell. >> So, I have modified the patch as you suggested. >> >> Please find the attachment for the same. >> >> Thanks, >> Khushboo >> >> On Fri, Apr 1, 2016 at 2:59 PM, Ashesh Vashi < >> ashesh.vashi@enterprisedb.com> wrote: >> >>> Hi Khushboo, >>> >>> I am reluctant to use this code as it is. >>> I would prefer you create just helper functions (i.e. initialize, >>> remove) for the dependents in Backgrid.Cell, and then use them directly >>> from the different cell itself. >>> Because - this functionality limits us to us only with the string type. >>> >>> Anyway - we will be using the dependent functionality for very >>> attributes. >>> >>> >>> You can extend them directly in the Node's model (schema). >>> >>> -- >>> >>> Thanks & Regards, >>> >>> Ashesh Vashi >>> EnterpriseDB INDIA: Enterprise PostgreSQL Company >>> >>> >>> >>> *http://www.linkedin.com/in/asheshvashi* >>> >>> >>> On Wed, Mar 30, 2016 at 6:39 PM, Khushboo Vashi < >>> khushboo.vashi@enterprisedb.com> wrote: >>> >>>> Hi, >>>> >>>> Please find the attached patch for the Backgrid *StringDepsCell.* >>>> >>>> The *StringDepsCell* displays HTML escaped strings and accepts anything typed in. >>>> Also, Listen to the dependent fields. >>>> >>>> >>>> Usage of the Backgrid Cell: >>>> >>>> If the Precision cell is dependent on the Datatype then: >>>> >>>> { >>>> id: 'precision', label:'{{ _('Precision') }}', type: 'test' >>>> cell: *Backgrid.Extension.StringDepsCell*, deps: ['datatype'] >>>> >>>> } >>>> >>>> >>>> Thanks, >>>> Khushboo >>>> >>>> >>>> >>>> -- >>>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) >>>> To make changes to your subscription: >>>> http://www.postgresql.org/mailpref/pgadmin-hackers >>>> >>>> >>> >> > --001a1135e456ca8c7c052fcd4fd6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Khushboo,

<= div>


On Tue, Apr 5, 2016 at 10:59 AM, Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:
Hi Ashesh,

I have changed the fu= nction name (from render_deps to updateUIDeps), which will be= called on the dependent field change, as per your suggestion.
<= /blockquote>
I've updated the patch.
Please try this.
I think - 'updateUIDeps' is not the write name.
A = Cell can do anything, when dependent changed, hence - I renamed it with = 9;dependentChanged'.

Also, The user is not goi= ng to extend existing cell from the DependendsCell, but - only going to use= the functions.
Hence - I have created a separate class for it in= stead of extend it from Backgrid.Cell.

--

Thanks & Regards,
=
Ashesh Va= shi
EnterpriseDB INDIA:=C2=A0Enterprise PostgreSQL Company


<= /span>


Please find attached patch for the same.

Th= anks,
Khushboo

On Fri, Apr 1, 2016 at= 3:56 PM, Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:
Hi Ashesh,
Yes, agreed. This implementation limits us to use only String C= ell.
So, I have modified the patch as you suggested.
Please find the attachment for the same.

<= div>Thanks,
Khushboo

On Fri, Apr 1, 2016 at 2:59 PM, Ashesh Va= shi <ashesh.vashi@enterprisedb.com> wrote:
Hi Khushboo,

I am reluct= ant to use this code as it is.
I would prefer you create just hel= per functions (i.e. initialize, remove) for the dependents in Backgrid.Cell= , and then use them directly from the different cell itself.
Because - t= his functionality limits us to us only with the string type.

=
Anyway - we will be using the dependent functionality for very a= ttributes.


You can extend them dire= ctly in the Node's model (schema). =C2=A0=C2=A0

--

Than= ks & Regards,

Ashesh VashiEnterpriseD= B INDIA: E= nterprise PostgreSQL Company


http://www.linkedin.com/in/asheshvashi


On Wed, Mar 30, 2016 at 6:39 PM, K= hushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:
Hi,

Please find the attached patch for the Backgrid StringDepsCe= ll.
The StringDepsCell displays HTML escaped strings an=
d accepts anything typed in.
Also, Listen to the dependent fields.


If the Precision cell is dependent on the Data= type then:
{
id: 'precision', label:'{{ _(= 9;Precision') }}', type: 'test'
cell: Backgrid.Exte= nsion.StringDepsCell, deps: ['data= type']
}

Tha= nks,
Khushboo=C2=A0



--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers=





--001a1135e456ca8c7c052fcd4fd6-- --001a1135e456ca8c81052fcd4fd8 Content-Type: application/octet-stream; name="depends_v2.patch" Content-Disposition: attachment; filename="depends_v2.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_imomu64j1 ZGlmZiAtLWdpdCBhL3dlYi9wZ2FkbWluL3N0YXRpYy9qcy9iYWNrZ3JpZC9i YWNrZ3JpZC5wZ2FkbWluLmpzIGIvd2ViL3BnYWRtaW4vc3RhdGljL2pzL2Jh Y2tncmlkL2JhY2tncmlkLnBnYWRtaW4uanMKaW5kZXggOTk2NWYxYi4uNmZj MmFiOSAxMDA2NDQKLS0tIGEvd2ViL3BnYWRtaW4vc3RhdGljL2pzL2JhY2tn cmlkL2JhY2tncmlkLnBnYWRtaW4uanMKKysrIGIvd2ViL3BnYWRtaW4vc3Rh dGljL2pzL2JhY2tncmlkL2JhY2tncmlkLnBnYWRtaW4uanMKQ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gIGRlcHMgPSBzZWxmLmNvbHVtbi5nZXQoJ2RlcHMnKTsKKworICAgICAg ICBpZiAoZGVwcyAmJiBfLmlzQXJyYXkoZGVwcykpIHsKKyAgICAgICAgICBf LmVhY2goZGVwcywgZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgYXR0ckFy ciA9IGQuc3BsaXQoJy4nKTsKKyAgICAgICAgICAgIG5hbWUgPSBhdHRyQXJy LnNoaWZ0KCk7CisKKyAgICAgICAgICAgIHNlbGYuc3RvcExpc3RlbmluZyhz ZWxmLm1vZGVsLCAiY2hhbmdlOiIgKyBuYW1lLCBzZWxmLmRlcGVuZGVudENo YW5nZWQpOworICAgICAgICAgIH0pOworICAgICAgICB9CisgICAgICB9Cisg ICAgfSk7CisKICAgcmV0dXJuIEJhY2tncmlkOwogCiB9KSk7Cg== --001a1135e456ca8c81052fcd4fd8 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers --001a1135e456ca8c81052fcd4fd8--