CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Default button on dynamically created frames

by Davide » 31 Dec 2014 12:22

Hello,

like you suggest me in one of my previous posts to set a "default" button on a form I should use the following code in the form Javascript :
Code: Select all
$(document).ready(function () {
      $("input").on("keydown", function (event) {
            var keycode = (event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode));
            if (keycode == 13) {
                  $(<#FindCustomerButton#>).click();
                  return false;
            } else {
                  return true;
            }
      });
});


and in the OnCreate event of the form :
Code: Select all
JavaScript.Text := StringReplace(JavaScript.Text, '$(<#FindCustomerButton#>)','document.getElementById('''FindCustomerButton.JQHTMLName + ''')',    [rfReplaceAll, rfIgnoreCase]);   


It has worked fine in forms but now I need to set a default button in a ajax dynamically created frame.
How can I achieve the same behaviour as in the form?

Thank you and happy new year!
Davide
Davide
 
Posts: 150
Joined: 14 Oct 2013 11:33

by Alexander Bulei » 31 Dec 2014 15:25

Hi Davide,

We have already implemented the vcl "default" funcionality in our suite.
Check the IWCGJQButton.Default property.

http://www.cgdevtools.com/docs/_html/IWCGJQButton.TIWCGJQDefaultButtonOptions.htm

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to General

Who is online

Users browsing this forum: No registered users and 87 guests

Contact Us.