Jump to content


Photo

Questions about UniDBGrid

unidbgrid roweditor

  • Please log in to reply
25 replies to this topic

#21 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4148 posts

Posted 22 November 2017 - 04:52 PM

Hi,

 

Ok, we will check it


  • 0

#22 arilotta

arilotta

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 83 posts
  • LocationTrieste, Italy

Posted 23 November 2017 - 08:40 AM

Thank you Delphi Dev.

jrp, if you want to achieve the behaviour at point 2,  add the following proc to the OnStateChange handler for the datasource bound to your dataset:

 

procedure TMainForm.SRCconfig_LKStateChange(Sender: TObject);
begin
  if (Sender as TOraDataSource).State in [dsEdit, dsInsert] then
    begin
      GRDconfig_LK.Options:=GRDconfig_LK.Options+[dgEditing];
      GRDconfig_LK.SetFocus;
    end
  else
    GRDconfig_LK.Options:=GRDconfig_LK.Options-[dgEditing];
end;

  • 0

#23 jrp

jrp

    Member

  • Members
  • PipPip
  • 13 posts

Posted 23 November 2017 - 11:57 PM

Hi arilotta,

 

Thank you for the workaround. I have not tried it yet, but looking at your code, I think it will work.

 

I hope someday it will be fixed in UniGUI so programmers can expect same behaviour in UniGUI like in VCL.


  • 0

#24 zhyhero

zhyhero

    Newbie

  • uniGUI Subscriber
  • Pip
  • 9 posts

Posted 10 February 2018 - 08:52 AM

Find another way to modify the text of roweditor's 'confirm' and 'cancel' button.

in unibasicgrid unit,change the red color code to your string. (the old version)

Or in Vcl.consts unit,change the value of SMsgDlgCancel and SMsgDlgConfirm.

 

procedure TUniBasicGrid.ConfigLoadCompleted;
begin
  if FHeaderTitle<>'' then
  begin
    JSConfig('title', [FHeaderTitle]);
    JSConfig('titleAlign', [GetAlignWebText(FHeaderTitleAlign)]);
  end;

  if FCellCursor<>crDefault then
    JSAssign('xcursor', [Cursor2Web(FCellCursor)]);

  if not FStripeRows then
    JSConfigObject('viewConfig', 'stripeRows', [FStripeRows]);

  if not FTrackOver then
    JSConfigObject('viewConfig', 'trackOver', [False]);

  if gcfgSupportsEditor in FInternalConfig then
  begin
    if FRowEditor then
    begin
      JSConfigPlugin('Ext.grid.plugin.RowEditing',
        [
          'pluginId','uniGridEditor',
          'isRowEditor', True,
          'cancelBtnText', uniRemoveAmp(SMsgDlgCancel),
          'saveBtnText', uniRemoveAmp(SMsgDlgConfirm)
          'clicksToEdit', FClicksToEdit,
          'editorCfg', JSObject([
            'listeners', JSObject([
              'beforehide', JSObject([
                'fn', JSFunction('me', 'return(me.canhide === true)'),
                'scope', JSStatement('this')
                ])
              ])
            ]),
           'listeners', JSObject([
              'beforeedit', JSObject([
                'fn', JSFunction('me, context', 'return (!context.grid.rdonly)')
              ])
            ])
          ]
      );
    end
    else
    begin
      JSConfigPlugin('Ext.grid.plugin.CellEditing',
        [
//          'triggerEvent', 'cellfocus',
          'pluginId','uniGridEditor',
          'clicksToEdit', FClicksToEdit
        ]
      );
    end;
  end;


  • 0

#25 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4148 posts

Posted 10 February 2018 - 09:23 AM

Hi,

 

Find another way to modify the text of roweditor's 'confirm' and 'cancel' button.

in unibasicgrid unit,change the red color code to your string. (the old version)

Or in Vcl.consts unit,change the value of SMsgDlgCancel and SMsgDlgConfirm.

 

...

 

Which edition and build are you using ?


  • 0

#26 zhyhero

zhyhero

    Newbie

  • uniGUI Subscriber
  • Pip
  • 9 posts

Posted 11 February 2018 - 05:39 AM

Hi,

 

 

Which edition and build are you using ?

v 0.99.96.1346 pro com

and v 1.0.0.1424 can also try to do this as globe change.

These texts are not in Extjs locale files.


  • 0





Also tagged with one or more of these keywords: unidbgrid, roweditor

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users