Jump to content

Unidbgrid unibutton in statusbar


Canestraro

Recommended Posts

Here is an extract from one of my forms - the only problem is I have not worked out yet how to change the dates outside of the Date Grid Ajax Events, that is I can get Date Changes via their respective events but I want to access these date objects when the Sync Button is pressed, in other words get date from FromDateID and Set ToDateID  with the same date. Happy for some help.

  ////////////////////////////////////////////////////////////////////////////// 
  // Grid Uni Events (Buttons/Ajax) 
  with grdSupplierB01 do begin 
    ClientEvents.UniEvents.Clear; 
    MyScript:= 'pagingBar.afterCreate=function pagingBar.afterCreate(sender) ' +
    '{ ' +
    ' ' +
    '  sender.add( ' +
    '  [ ' +
    '    { ' +
    '      xtype: "tbseparator" ' +
    '    }, ' +
    '    { ' +
    '      xtype: "button", ' +
    '      iconCls: "pictos pictos-refresh", ' +
    '      width: 24, ' +
    '      height: 24, ' +
    '      tooltip: "UnDo Changes", ' +
    '      handler: function() ' +
    '      { ' +
    '        ajaxRequest(fSupplierB.grdSupplierB01, "_UnDoChanges_", []); ' +
    '      } ' +
    '    }, ' +
    '    { ' +
    '      xtype: "tbseparator" ' +
    '    }, ' +
    '    { ' +
    '      xtype: "button", ' +
    '      iconCls: "pictos pictos-pencil", ' +
    '      width: 24, ' +
    '      height: 24, ' +
    '      tooltip: "Edit Record", ' +
    '      handler: function() ' +
    '      { ' +
    '        ajaxRequest(fSupplierB.grdSupplierB01, "_EditRecord_", []); ' +
    '      } ' +
    '    }, ' +
    '    { ' +
    '      xtype: "tbseparator" ' +
    '    }, ' +
    '    { ' +
    '      xtype: "button", ' +
    '      iconCls: "pictos pictos-check2", ' +
    '      width: 24, ' +
    '      height: 24, ' +
    '      tooltip: "Post", ' +
    '      handler: function()  ' +
    '      { ' +
    '        ajaxRequest(fSupplierB.grdSupplierB01, "_PostRecord_", []); ' +
    '      } ' +
    '    }, ' +
    '    { ' +
    '      xtype: "tbseparator" ' +
    '    }, ' +
    '    { ' +
    '      xtype: "button", ' +
    '      iconCls: "pictos pictos-add", ' +
    '      width: 24, ' +
    '      height: 24, ' +
    '      tooltip: "Add", ' +
    '      handler: function() ' +
    '      { ' +
    '        ajaxRequest(fSupplierB.grdSupplierB01, "_AddRecord_", []); ' +
    '      }  ' +
    '    }, ' +
    '    { ' +
    '      xtype: "tbseparator" ' +
    '    }, ' +
    '    { ' +
    '      xtype: "button", ' +
    '      iconCls: "pictos pictos-delete", ' +
    '      width: 24, ' +
    '      height: 24, ' +
    '      tooltip: "Delete", ' +
    '      handler: function() ' +
    '      { ' +
    '        ajaxRequest(fSupplierB.grdSupplierB01, "_DeleteRecord_", []); ' +
    '      } ' +
    '    }, ' +
    '    { ' +
    '      xtype: "tbseparator" ' +
    '    }, ' +
    '    { ' +
    '      xtype: "datefield", ' +
    '      fieldLabel: "", ' +
    '      formatText: "From Date", ' +
    '      labelWidth: "0px", ' +
    '      format: "d/m/Y", ' +
    '      value: new Date(), ' +
    '      id: "FromDateID", ' +
    '      width: 120, ' +
    '      startDay: 1, ' +
    '      listeners: ' +
    '      { ' +
    '        change: function(el, v) ' +
    '        { ' +
    '          ajaxRequest(fSupplierB.grdSupplierB01, "_FromDateIDChange_", ["dtIndx=0", "val=" + Ext.Date.format(v, "d/m/Y")]) ' +
    '        } ' +
    '      } ' +
    '    }, ' +
    '    { ' +
    '      xtype: "tbseparator" ' +
    '    }, ' +
    '    { ' +
    '      xtype: "button", ' +
    '      iconCls: "pictos pictos-calendar", ' +
    '      width: 24, ' +
    '      height: 24, ' +
    '      tooltip: "Sync Dates", ' +
    '      handler: function() ' +
    '      { ' +
    '        ajaxRequest(fSupplierB.grdSupplierB01, "_SyncDateID_", []); ' +
    '      } ' +
    '    }, ' +
    '    { ' +
    '      xtype: "tbseparator" ' +
    '    }, ' +
    '    { ' +
    '      xtype: "datefield", ' +
    '      fieldLabel: "", ' +
    '      formatText: "To Date", ' +
    '      labelWidth: "0px", ' +
    '      format: "d/m/Y", ' +
    '      value: new Date(), ' +
    '      id: "ToDateID", ' +
    '      width: 120, ' +
    '      startDay: 1, ' +
    '      listeners: ' +
    '      { ' +
    '        change: function(el, v) ' +
    '        { ' +
    '          ajaxRequest(fSupplierB.grdSupplierB01, "_ToDateIDChange_", ["dtIndx=0", "val=" + Ext.Date.format(v, "d/m/Y")]) ' +
    '        } ' +
    '      } ' +
    '    }, ' +
    '    { ' +
    '      xtype: "tbseparator" ' +
    '    }, ' +
    '  ]); ' +
    '} '; 
    ClientEvents.UniEvents.Add(MyScript); 
  end; 
 

Link to comment
Share on other sites

13 hours ago, Canestraro said:

is there a possibility to create two buttons in the unidbgrid status bar as shown in the image?

Someone can help me as if I have, because I have to capture the click as well.

Hello,

The forum has solutions to your questions.
You can also use the PagingBarAuxControl property of the grid.

Please use the search engine on the forum.

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