Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1anJYV-0002iq-J6 for pgadmin-hackers@arkaria.postgresql.org; Tue, 05 Apr 2016 05:29:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1anJYU-00025T-U6 for pgadmin-hackers@arkaria.postgresql.org; Tue, 05 Apr 2016 05:29:34 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1anJYG-0001qw-PG for pgadmin-hackers@postgresql.org; Tue, 05 Apr 2016 05:29:21 +0000 Received: from mail-lb0-x229.google.com ([2a00:1450:4010:c04::229]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1anJYC-0007yz-Pw for pgadmin-hackers@postgresql.org; Tue, 05 Apr 2016 05:29:19 +0000 Received: by mail-lb0-x229.google.com with SMTP id vo2so1995536lbb.1 for ; Mon, 04 Apr 2016 22:29:16 -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:date:message-id:subject:from:to :cc; bh=4taLzee8S7eTXAI9eJkt4LD/CzRt9Jejztr30Ax8ga4=; b=yym1NGONBB+OEVQMwsWFCcs6IfZACu3u883NrVVBuxJy/NqGKtHL0mzBQh6bkDCmkR jKfBV8umUea3lsTZDz07K78Jpxnrbpw7CS13CFSaPCdt4Hw9QQHWms4YfAPiemO5EaRs RS4+kfiWusMLqaG9k1EVCQfUe9PJHv+StERdKkXW3SqPsJarFjwS05CKSvHYgPuGUCCM lP4f3mBAk/ln2Ajoc7UjYzWuXpxMia8DU8sf740j6SZPRmBhzQAAcfyJqWXePTk4EzZ/ ofmlW5gBnFb3tpUt63jnAp+gpHG7wRLMv7mZRB6LSsXr8C3iUE0KPuOh2Px/lzUjYrk3 9U8g== 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:cc; bh=4taLzee8S7eTXAI9eJkt4LD/CzRt9Jejztr30Ax8ga4=; b=IHIZFDPG9EQMFuzdEA8PQ+Gn2mdGq2Ev6CE+mHL5h04DuVbodkaRz2IRBZIZNKDcEB oSX5bb349kQ7szmKgiQIZo83soZyr6zbQ/ndnPZ2Ct0m4uHhNi8AcPKAAgzQ+vkIR1ca FmBhGU7na3MAGRYkjuVSfDTlGn5jRgapB5xF2+aPdzB13Oa9kBIizwjOcfxm190LCCn7 v0uqNIYUTjcjPH+L+cnrxXTcHD6XUhSS2XTpAifG406hKPmsCDZ9EeoA4eioA9LGmhjW VY/JqObk5Zf8Eds4bShQeZCwTqoPz5y9/aSlNApsJSPCnHz4HzduDIcsPBnacx7U4YSX H23w== X-Gm-Message-State: AD7BkJLG7ALSDpOwwUtCJuyg9DTVYt58cRO37Jo9UVuVkB8NFCj3ImdH6rPyUtUfkaM+/VxTTQRppYgh6JcOIixE MIME-Version: 1.0 X-Received: by 10.112.199.138 with SMTP id jk10mr8003703lbc.91.1459834154386; Mon, 04 Apr 2016 22:29:14 -0700 (PDT) Received: by 10.25.144.81 with HTTP; Mon, 4 Apr 2016 22:29:14 -0700 (PDT) In-Reply-To: References: Date: Tue, 5 Apr 2016 10:59:14 +0530 Message-ID: Subject: Re: [pgAdmin4][Patch]: Backgrid StringDepsCell From: Khushboo Vashi To: Ashesh Vashi Cc: pgadmin-hackers Content-Type: multipart/mixed; boundary=001a11c3358a343383052fb620db 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 --001a11c3358a343383052fb620db Content-Type: multipart/alternative; boundary=001a11c3358a34337f052fb620d9 --001a11c3358a34337f052fb620d9 Content-Type: text/plain; charset=UTF-8 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. 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 >>> >>> >> > --001a11c3358a34337f052fb620d9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
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.

Please find attached patch for the same.

Tha= nks,
Khushboo

On Fri, Apr 1, 2016 at 3:56 PM, Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:
Hi Ashesh,

Yes, agr= eed. 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 a= m reluctant to use this code as it is.
I would prefer you create = just helper functions (i.e. initialize, remove) for the dependents in Backg= rid.Cell, and then use them directly from the different cell itself.
Bec= ause - this functionality limits us to us only with the string type.
<= div>
Anyway - we will be using the dependent functionality fo= r very attributes.


You can extend t= hem directly in the Node's model (schema). =C2=A0=C2=A0

--=

Thanks & Regar= ds,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise Post= greSQL Company

<= br>

<= a href=3D"http://www.linkedin.com/in/asheshvashi" target=3D"_blank">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= StringDepsCell.
The StringDepsCell displays HTML es=
caped strings and accepts anything typed in.
Also, Listen to the depende= nt fields.

Usage of the Backgrid Cell:

If the Precision cell is dep= endent on the Datatype then:
{
id: 'precision', l= abel:'{{ _('Precision') }}', type: 'test'
cell= : Backgrid.Extension.StringDepsCell, deps: ['datatype']
}
=
Thanks,
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=




--001a11c3358a34337f052fb620d9-- --001a11c3358a343383052fb620db Content-Type: text/x-patch; charset=US-ASCII; name="pgAdmin4_Backgrid_Depscell_ver1.patch" Content-Disposition: attachment; filename="pgAdmin4_Backgrid_Depscell_ver1.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_immzjw9h1 ZGlmZiAtLWdpdCBhL3dlYi9wZ2FkbWluL3N0YXRpYy9qcy9iYWNrZ3JpZC9i YWNrZ3JpZC5wZ2FkbWluLmpzIGIvd2ViL3BnYWRtaW4vc3RhdGljL2pzL2Jh Y2tncmlkL2JhY2tncmlkLnBnYWRtaW4uanMKaW5kZXggNGIyMzNkMi4uOWRl MTlmYSAxMDA2NDQKLS0tIGEvd2ViL3BnYWRtaW4vc3RhdGljL2pzL2JhY2tn cmlkL2JhY2tncmlkLnBnYWRtaW4uanMKKysrIGIvd2ViL3BnYWRtaW4vc3Rh dGljL2pzL2JhY2tncmlkL2JhY2tncmlkLnBnYWRtaW4uanMKQEAgLTQ0Nyw2 ICs0NDcsNDYgQEAKICAgICBlZGl0b3I6IFRleHRhcmVhQ2VsbEVkaXRvcgog ICB9KTsKIAorICAvKioKKyAgICBEZXBlbmRlbnRDZWxsIGNhbiBiZSB1c2Vk IGFzIGEgYmFzZSBjbGFzcyBmb3IgYW55IGJhY2tncmlkIGNlbGwgd2hpY2gg aXMKKyAgICBkZXBlbmRlbnQgb24gYW5vdGhlciBjZWxsLiBJdCB3aWxsIGxp c3RlbiB0byB0aGUgZGVwZW5kZW50IGZpZWxkcy9jZWxscy4KKworICAgIE5l ZWQgdG8gRXh0ZW5kIHRoaXMgY2VsbCB3aGVuZXZlciByZXF1aXJlZCBhbmQg aGFzIHRvIGltcGxlbWVudCB1cGRhdGVVSURlcHMKKyAgICBmdW5jdGlvbiB0 byBsaXN0ZW4gdG8gdGhlIGRlcGVuZGVudCBmaWVsZHMgY2hhbmdlIGV2ZW50 LgorCisgICAgQGNsYXNzIEJhY2tncmlkLkV4dGVuc2lvbi5EZXBlbmRlbnRD ZWxsCisgICAgQGV4dGVuZHMgQmFja2dyaWQuRGVwZW5kZW50Q2VsbAorICAq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c3RlbmluZyhzZWxmLm1vZGVsLCAiY2hhbmdl OiIgKyBuYW1lLCBzZWxmLnVwZGF0ZVVJRGVwcyk7CisgICAgICAgIH0pOwor ICAgICAgfQorICAgICAgQmFja2JvbmUuVmlldy5wcm90b3R5cGUucmVtb3Zl LmFwcGx5KHNlbGYsIGFyZ3VtZW50cyk7CisgICAgfQorICB9KTsKKwogICBy ZXR1cm4gQmFja2dyaWQ7CiAKIH0pKTsK --001a11c3358a343383052fb620db 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 --001a11c3358a343383052fb620db--