Allen Posted April 6, 2022 Share Posted April 6, 2022 I am struggling with the conversion of an ext app (not unigui) into a unigui app. In my old app I created a lot of windows as follows win = desktop.createWindow({ id: 'newTicket-win', closeAction:'hide', title: tTitle, iconCls:'icon-help', modal:true, TixToView: ticketID, width:twidth, height:theight, layout:{ type:'fit' }, items:[{ xtype:'ticketForm', id: 'ticketFormID', flex:1 }], onEsc: function() { var me = this; me.hide(); }, listeners: { beforeclose: function( window ) { var formPanel = Ext.getCmp('newTicket-win'); var childPanel = formPanel.down('ticketForm'); if (childPanel.getForm().isDirty()) { Ext.Msg.confirm( 'Closing confirmation', 'You have unsaved data are you sure you want to close?', function( answer ) { if( answer == "yes" ) { window.destroy(); } } ); return false; } } } }); how best does one achieve the equivalent of the beforeclose event from the Ext code above in UniGui. -Allen Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 6, 2022 Share Posted April 6, 2022 Hello, 27 minutes ago, Allen said: I am struggling with the conversion of an ext app (not unigui) into a unigui app. In my old app I created a lot of windows as follows Sorry, why? 27 minutes ago, Allen said: how best does one achieve the equivalent of the beforeclose event from the Ext code above in UniGui. Can you please explain in more detail? Quote Link to comment Share on other sites More sharing options...
Allen Posted April 6, 2022 Author Share Posted April 6, 2022 Sherzod; 25 minutes ago, Sherzod said: Sorry, why? My old environment was isapi dll + ExtJS (This was started with ExtJS 3.x 10+ years ago). trying to draw lines between how I did things previously and UniGui has been a personal challenge. 29 minutes ago, Sherzod said: Can you please explain in more detail? In a generic ExtJS form there is a simple method ".getForm().isDirty()" that keeps track of a user modifying form fields. This is nice and simple, relatively bulletproof way of helping the user not lose data edits by navigating away from the form. 1 hour ago, Allen said: if (childPanel.getForm().isDirty()) { Ext.Msg.confirm( 'Closing confirmation', 'You have unsaved data are you sure you want to close?', function( answer ) { if( answer == "yes" ) { window.destroy(); } If there is no similar function within UniGui then I would need to build my own capability attached to every input field in the application which will eventually lead to inconsistencies and potential "LOST" edits. -Allen Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 6, 2022 Share Posted April 6, 2022 23 minutes ago, Allen said: If there is no similar function within UniGui then I would need to build my own capability attached to every input field in the application which will eventually lead to inconsistencies and potential "LOST" edits. If I understand you correctly, you can search the forum for these keywords: "isValid", "validate"... Quote Link to comment Share on other sites More sharing options...
Allen Posted April 7, 2022 Author Share Posted April 7, 2022 Thank you, Following your suggestion I found which will get me what I am after. Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.