Jump to content
uniGUI Discussion Forums

Recommended Posts

When click in ExtEvents to open, appears message error:

 

[Window Title]
DbGrid1 - Delphi XE6 - Main [built]
[Content]
Resource EXTJS_EXT_FORM_TRIGGERFIELD not found
[OK]

 

How to fix??
 

Share this post


Link to post
Share on other sites
Replace In 
procedure TUniButtonEdit.ConfigJSClasses(ALoading: Boolean);
from 
  JSObjects.DefaultJSClassName:='Ext.form.TriggerField';
 
to
 
  JSObjects.DefaultJSClassName:='Ext.form.field.Trigger';

 

 

 

  • Upvote 1

Share this post


Link to post
Share on other sites

 

Replace In 
procedure TUniButtonEdit.ConfigJSClasses(ALoading: Boolean);
from 
  JSObjects.DefaultJSClassName:='Ext.form.TriggerField';
 
to
 
  JSObjects.DefaultJSClassName:='Ext.form.field.Trigger';

 

 

 

 

 

Works fine!!

Thank you Stas!

Share this post


Link to post
Share on other sites

Simple ext.form.triggerfield unigui wrapper

Hi Stas,
 
Thanks for sharing.
Grateful.
 

You might call this component to a form ? When you press the button , do a ShowModal a way , I tried but I failed to show how

 

I appreciate the support you can give me

 

 

code:

unit UniButtonEdit;
 
interface
uses SysUtils,Classes,uniGuiTypes, uniGUIClasses,UniEdit
, uniGUIForm , uniGUIAbstractClasses, uniGUIApplication ,
  uniGUIBaseClasses , controls
;
type
   TIconCls = (action, add, arrow_up, arrow_right, arrow_down, arrow_left, bookmarks, compose, delete, download, favorites, info, more, refresh, reply, search, settings, star, team, time, trash, user);
 
Type
  TUniButtonEdit = class(TUniEdit)
  private
    FOnButtonClick: TNotifyEvent;
    FIconCls: String;
    procedure SetIconCls(const Value: String);
    function GetTriggerCls: String;
    procedure ShowForma;
  protected
    procedure DOHandleEvent(EventName: string; Params: TUniStrings); override;
    procedure ConfigJSClasses(ALoading: Boolean); override;
    procedure LoadCompleted; override;
    procedure Click ; override;    // CRAMIREZ
  public
    constructor Create(AOwner:TComponent); override;
  published
 
     property OnButtonClick:TNotifyEvent read FOnButtonClick write FOnButtonClick;
      property IconCls:String read FIconCls write SetIconCls;
      property triggerCls:String read GetTriggerCls;
 
 
  End;
 
procedure Register;
 
implementation
   uses UniButtonForm ;    // CRAMIREZ
 
 
procedure Register;
begin
  RegisterComponents('uniGUI Custom', [TUniButtonEdit]);
end;
 
{ TUniButtonEdit }
 
function TUniButtonEdit.GetTriggerCls: String;
begin
 if FIconCls<>'' then
 Result:='x-form-'+FIconCls+'-trigger'
 else
 Result:='';
 
 
 
end;
 
 
procedure TUniButtonEdit.ConfigJSClasses(ALoading: Boolean);
begin
  inherited;
  JSObjects.DefaultJSClassName:='Ext.form.TriggerField';
 
 
end;
 
constructor TUniButtonEdit.Create(AOwner: TComponent);
begin
  inherited;
 FIconCls:='search';   //  <----- tipo de icono
 
end;
 
procedure TUniButtonEdit.Click;
begin
  inherited;
  ShowForma;     // CRAMIREZ
end;
 
 
procedure TUniButtonEdit.ShowForma;    // CRAMIREZ
VAR
  FUniButtonForm : TFUniButtonForm;
begin
   text:= 'YYYY';
   TFUniButtonForm.create(uniapplication);
  FUniButtonForm.SHOWMODAL(
   procedure(Sender: TComponent; Result: Integer)
   var
    i:Integer;
   begin
      // LOGIN OK
      if Result = mrOk then begin
      end ;
      if Result = mrcancel then begin
      end;
   end)
 
 
end;
 
procedure TUniButtonEdit.DOHandleEvent(EventName: string; Params: TUniStrings);
 
begin
 
if (EventName='buttonclick') then begin
 
 if Assigned(FOnButtonClick) then
   FOnButtonClick(Self);
 
end;
 
 inherited;
 
 
end;
 
procedure TUniButtonEdit.LoadCompleted;
begin
  inherited;
 
if WebMode then
begin
 if FIconCls<>'' then
 JSCode('triggerCls:"'+triggerCls+'"');
 JSCode('hideTrigger:false');
 JSAfterCreate(JSName+'.onTriggerClick=function(){ajaxRequest('+JSName+',"buttonclick",[]);};');
 
end;
end;
 
 
 
procedure TUniButtonEdit.SetIconCls(const Value: String);
begin
  FIconCls := Value;
end;
 
 
end.
 

 

Share this post


Link to post
Share on other sites

Hello,

I tried to make in Trail 1321.

type
  TUnimButtonEdit = class(TUnimEdit)
  private

when show "TUnimForm", I get "Ajax error" Ext.form.field is undefined. 

How to use for mobile this component?

Thank you.

Share this post


Link to post
Share on other sites

Setting the ReadOnly property to true makes the trigger buttons to disappear. Is there a workaround?

Share this post


Link to post
Share on other sites

Hi,

 

If I understand you correctly, you can use triggers config for this:

http://forums.unigui.com/index.php?/topic/7969-how-to-add-a-search-icon-in-tuniedit/&do=findComment&comment=54542

 

This dowonload link already contains the update for ExtJS6 using the JSConfigObject to create the triggers.

If any user already uses the TUniButtonEdit in their projects, they can upgrade to that version that will work on the UniGUI Beta 1.0.2+  and higher versions.

 

And it also contains the UniButtonEditv6 package for ExtJS6 and new versions of UniGUI.

 

https://mega.nz/#!LlV1XRSA!TVMUEYGOlV-7Dp7TxyNt68BtXfRW2Pt7SLTS-0JQAS0

Share this post


Link to post
Share on other sites

VNG
NCMV


Verzonden vanaf mijn iPhone met Tapatalk Pro

Share this post


Link to post
Share on other sites

Something went wrong with my iPhone or so, sorry for the useless response.....  :wacko:

Share this post


Link to post
Share on other sites

×