Jump to content

uniEvents for afterCreate pagingBar of UniDBGrid


onur

Recommended Posts

Hi,

i created insert and delete buttons on pagingBar of uniDBGrid,

but buttons not working OnAjaxEvent in uniDBGrid, how to call new event name from ajaxRequest script ? 

my script like this below:

function pagingBar.afterCreate(sender)
{
  sender.items.items[0].hide();
  sender.items.items[8].hide();
  sender.items.items[10].hide();  
  sender.add(
  [
   {
   xtype: 'label',
   text: '0',
   cls: 'grdfooter',
   padding: '0 0 1 5'
   },
   '->',
   {
   xtype: 'button',
   icon: 'files/images/delete.png',
   tooltip: 'Delete Registry',
   handler: function()
            {
             ajaxRequest(UniDBKZM, 'delRow',
             ["slctd="+UniDBKZM.getSelectionModel().getCount()]);
            }
    },
    {xtype: 'tbseparator'},
    {
       xtype: 'button',
       icon: 'files/images/ok.png',
       tooltip: 'Insert Registry',
       handler: function()
                {
                ajaxRequest(UniDBKZM, 'insRow',
                ["slctd="+UniDBKZM.getSelectionModel().getCount()]);
                }
    }
  ]
  );
}

procedure TFFaturaOnaylamaEkrani2.UniDBKZMAjaxEvent(Sender: TComponent;
  EventName: string; Params: TStrings);
var
selectedRows:Integer;
begin

  if SameText(EventName, 'delRow') = True then
  begin
    selectedRows := StrToIntDef(Params.Values['slctd'],0);
    ShowMessage(IntToStr(slctdRows));
  end;
end;

-----------------

thanks,

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...