gpaulino Posted February 4, 2017 Share Posted February 4, 2017 Help with html buttons I have a button created in html and I would like that when I click the button it executes what I want, I have doubt of how to do somebody could guide me. This is an example of the button in html <Button type = "button" name = "normal"> Normal </ button> Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 4, 2017 Share Posted February 4, 2017 Hi, Where your html will be placed, and what do you want? Best regards. Quote Link to comment Share on other sites More sharing options...
gpaulino Posted February 4, 2017 Author Share Posted February 4, 2017 Inside a column of an unidbgrid, is that I want to make the effect of two or three action buttons inside a column as handled in boostrap. example: Example Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 4, 2017 Share Posted February 4, 2017 http://forums.unigui.com/index.php?/topic/4130-add-action-columns-to-unidbgrid-at-runtime http://forums.unigui.com/index.php?/topic/7307-dbgrid/&do=findComment&comment=37228 Quote Link to comment Share on other sites More sharing options...
gpaulino Posted February 4, 2017 Author Share Posted February 4, 2017 I have that component the problem with that component is that it only handles image, does not handle html try to modify it but it presented me a lot of errors. I can put the button with html in the unidbgrid the problem is as I detect when they click on a specific one. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 4, 2017 Share Posted February 4, 2017 I can put the button with html in the unidbgrid the problem is as I detect when they click on a specific one. function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts) { // 9 - yourBtnsColumn indx columns[9].width = 150; columns[9].renderer = function(val, meta, rec) { // generate unique id for an element var id = Ext.id(); var id2 = Ext.id(); Ext.defer(function() { Ext.widget('button', { renderTo: id, text: 'Edit', scale: 'small', handler: function() { Ext.Msg.alert("Hello World", "Edit...") } }); }, 50); Ext.defer(function() { Ext.widget('button', { renderTo: id2, text: 'Delete', scale: 'small', handler: function() { Ext.Msg.alert("Hello World", "Delete...") } }); }, 50); return Ext.String.format('<div><table><tr><td><div id="{0}"></div></td><td><div id="{1}"></div></td></tr></table>', id, id2); } } Quote Link to comment Share on other sites More sharing options...
mhmda Posted February 4, 2017 Share Posted February 4, 2017 You can use this technique to insert button in grid. Quote Link to comment Share on other sites More sharing options...
gpaulino Posted February 5, 2017 Author Share Posted February 5, 2017 Delphi Developer and mohammad, for the solution and the two are probre and I am implementing it when I finish sending a link to you to see how my uniDBGrid is left. Thank you very much Quote Link to comment Share on other sites More sharing options...
tappatappa Posted February 9, 2017 Share Posted February 9, 2017 Any idea on how to add a screenmask? Quote Link to comment Share on other sites More sharing options...
mhmda Posted February 9, 2017 Share Posted February 9, 2017 Use this approach: frmEmailSettings.grdEmails.showMask('Loading list...'); Quote Link to comment Share on other sites More sharing options...
tappatappa Posted February 10, 2017 Share Posted February 10, 2017 Use this approach: frmEmailSettings.grdEmails.showMask('Loading list...'); Hi mohammad, let me give you a bit of context: I have a TUniDBText (TextConversion = txtHTML) with the underlying query something like select '<table>' ||'<tr>' ||'<td colspan="2"><a href="#" onclick="javascript:ajaxRequest(MainForm.window,''openClick'');"style="text-decoration: none">' ||'<div class="mydivclass">DETAILS</div>' ||'</a></td>' ||'</tr>' ||'</table>' a_html from mytable where a_id=1 of course I am handling the event... void __fastcall TFormMain::UniFormAjaxEvent(TComponent *Sender, UnicodeString EventName, TUniStrings *Params) { if (EventName.Compare(L"openClick") == 0) { doSomething(); } } But since the "click" event might take a while to process I need a way to tell the HTML/javascript side to show a mask covering the HTML table (or the form). Quote Link to comment Share on other sites More sharing options...
tappatappa Posted February 10, 2017 Share Posted February 10, 2017 ok I figured it out, at first I thought you posted a piece of Delphi code. <a href="#" onclick="javascript:ajaxRequest(MainForm.window,'openClick');MainForm.window.showMask('wait');"style="text-decoration: none"> thanks Quote Link to comment Share on other sites More sharing options...
GerhardV Posted February 11, 2017 Share Posted February 11, 2017 Mohammad - where does the JS code go to get the HTML button showing up on the MainForm? 1 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.