Jump to content

Help button in html


gpaulino

Recommended Posts

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>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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);
    }
}
Link to comment
Share on other sites

 

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).

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...