public inbox for [email protected]
help / color / mirror / Atom feedCustomisable delete row message
2+ messages / 2 participants
[nested] [flat]
* Customisable delete row message
@ 2016-08-01 06:56 Akshay Joshi <[email protected]>
2016-08-01 14:19 ` Re: Customisable delete row message Dave Page <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Akshay Joshi @ 2016-08-01 06:56 UTC (permalink / raw)
To: pgadmin-hackers
Hi All
With current implementation message for delete row is hard coded 'Are you
sure you wish to delete this row?' in DeleteCell control. I have modified
this behaviour and make it customisable. User of this control can set their
own delete message.
Attached is the patch file, please review it and let me know the review
comments if any.
--
*Akshay Joshi*
*Principal Software Engineer *
*Phone: +91 20-3058-9517Mobile: +91 976-788-8246*
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers
Attachments:
[application/octet-stream] custom_delete_msg.patch (1.2K, 3-custom_delete_msg.patch)
download | inline diff:
diff --git a/web/pgadmin/static/js/backgrid/backgrid.pgadmin.js b/web/pgadmin/static/js/backgrid/backgrid.pgadmin.js
index 49edd99..8e737c4 100644
--- a/web/pgadmin/static/js/backgrid/backgrid.pgadmin.js
+++ b/web/pgadmin/static/js/backgrid/backgrid.pgadmin.js
@@ -252,6 +252,10 @@
});
var DeleteCell = Backgrid.Extension.DeleteCell = Backgrid.Cell.extend({
+ defaults: _.defaults({
+ defaultDeleteMsg: 'Are you sure you wish to delete this row?'
+ }, Backgrid.Cell.prototype.defaults),
+
/** @property */
className: "delete-cell",
events: {
@@ -266,9 +270,11 @@
Backgrid.callByNeed(this.column.get('canDeleteRow'),
this.column, this.model) : true;
if (canDeleteRow) {
+ var delete_msg = !_.isUndefined(this.column.get('customDeleteMsg')) ?
+ this.column.get('customDeleteMsg'): that.defaults.defaultDeleteMsg;
Alertify.confirm(
'Delete Row',
- 'Are you sure you wish to delete this row?',
+ delete_msg,
function(evt) {
that.model.collection.remove(that.model);
},
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Customisable delete row message
2016-08-01 06:56 Customisable delete row message Akshay Joshi <[email protected]>
@ 2016-08-01 14:19 ` Dave Page <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Dave Page @ 2016-08-01 14:19 UTC (permalink / raw)
To: Akshay Joshi <[email protected]>; +Cc: pgadmin-hackers
Thanks, applied.
On Mon, Aug 1, 2016 at 7:56 AM, Akshay Joshi <[email protected]>
wrote:
> Hi All
>
> With current implementation message for delete row is hard coded 'Are you
> sure you wish to delete this row?' in DeleteCell control. I have modified
> this behaviour and make it customisable. User of this control can set
> their own delete message.
>
> Attached is the patch file, please review it and let me know the review
> comments if any.
>
> --
> *Akshay Joshi*
> *Principal Software Engineer *
>
>
>
> *Phone: +91 20-3058-9517 <%2B91%2020-3058-9517>Mobile: +91 976-788-8246*
>
>
> --
> Sent via pgadmin-hackers mailing list ([email protected])
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>
>
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2016-08-01 14:19 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-08-01 06:56 Customisable delete row message Akshay Joshi <[email protected]>
2016-08-01 14:19 ` Dave Page <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox