Jump to content

zhyhero

uniGUI Subscriber
  • Posts

    131
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by zhyhero

  1.  

    Hi,

     

    One possible solution I guess 

     

    UniDBGrid -> ClientEvents -> ...

    function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts) 
    {
        var me = sender,
            maxY = 0;
    
    
        me.columnManager.columns.forEach(function(el) {
            if (el.fedit && el.fedit.getY() > maxY) {
                maxY = el.fedit.getY()
            }
        });
    
    
        if (maxY > 0) {
            me.columnManager.columns.forEach(function(el) {
                if (el.fedit) {
                    el.fedit.setY(maxY - el.fedit.getHeight());
                    el.fedit.setX(el.fedit.getX() - 5);
                }
            });
        }
    }

    I have test with these codes and .....column title missing.

    post-704-0-95427300-1527728728_thumb.png

     

    And If  not every column has filter  shows like this(with out these codes).

    post-704-0-21339800-1527728736_thumb.png

     

    DBGrid (With codes) Shows

    post-704-0-63539200-1527728742_thumb.png

     

     

  2. Hi Beginner,

    thanks a lot.

    But where is "after edit cell" event?

    All Extjs events (cell) work well when you navigate (select, etc.) , but not when you in "editing" state;

    I need to edit cell, press tab, and edit the next cell (without press Enter), with its value already refreshed (calculate). And naturally without post and edit continuosly dataset....

     

    I test these code with 1.10.0.1456,maybe work for you.

    write code in UniDBGrid's OnSetCellValue  event

     

     

    procedure TMainForm.UniDBGrid1SetCellValue(Sender: TObject; ACol,

      ARow: Integer; AField: TField; var Value: Variant);

    begin

      self.UniDBGrid1.DataSource.DataSet.Edit;

      self.UniDBGrid1.DataSource.DataSet.FieldByName(self.UniDBGrid1.Columns.Items[Acol].FieldName).Value:=Value;

      self.UniDBGrid1.DataSource.DataSet.Post;

    end;

  3. Sorry for my poor english first.

     

    UniDBGRID (unigui 1.10.0.1453 professional / FireFox Browser 59.0.3 X64)

    0.Locked column still can not dynamic create(add).
       Roweditor has no build in Property to set button's caption ("confirm" and "cancel") to other words .

    1.After dynamic create(add) columns , both scroll bar can not click and drag.
    2.Roweditor buttons paint at diffrent position , first time and other time (no column add or delete operation).

    post-704-0-18700200-1525576030_thumb.pngpost-704-0-69241300-1525576038_thumb.png

    3. If roweditor showed once, after dynamic create(add) or delete dbgird columns , roweditor cells paint at wrong postion ,about 5px shift.

    post-704-0-70757700-1525576046_thumb.png

    4.If roweditor showed once,dynamic create(add) or delete columns may by fire a error  "Could not set cell position :row:[x],column:[0]:a is null".

    post-704-0-84695500-1525576002_thumb.png

       And roweditor can not show after the error. Next time create(add) column will be blank cell and the dbgrid missing columns titles(all blank).

    post-704-0-74496000-1525576013_thumb.pngpost-704-0-21706500-1525576022_thumb.png

       And dbgrid missing dataset (click the refresh icon).

    5.Sometimes roweditor will paint with no cells.

    post-704-0-03025800-1525576054_thumb.png

     

    And there is a testcase Project1.rar

     

    I had used dbgrids much more in my projects.  the new ActionColumn is very good for me.

     

    Thank you for the easy useful and powerful products !

    谢谢你们的强力高效易于使用的产品!

  4.  

    Have you tried with the above solution?:

    with UniDBGrid1 do
        if RowEditor then
          JSInterface.JSAddListener('reconfigure', JSControl.JSFunction('me', 'if (me.getPlugin("uniGridEditor")) me.getPlugin("uniGridEditor").editor=null') );

     

    I have tried this ,workable.

    but i need the editors……

  5. I think , every time loaddata ,the roweditor's single editor's container's width ( html table ) increase 5px

     

    1st time

     

    col1

     

    <table class="x-field x-table-plain x-form-item x-form-type-text x-box-item x-field-default x-hbox-form-item" role="presentation" id="textfield-1048" style="table-layout: fixed; width: 345px; right: auto; left: 2px; top: 0px; margin: 0px;" cellpadding="0"><tbody><tr role="presentation" id="textfield-1048-inputRow" class="x-form-item-input-row"><td role="presentation" id="textfield-1048-labelCell" style="display:none;" halign="left" class="x-field-label-cell" width="105" valign="top"><label id="textfield-1048-labelEl" for="textfield-1048-inputEl" class="x-form-item-label x-unselectable x-form-item-label-left" style="width:100px;margin-right:5px;" unselectable="on"></label></td><td role="presentation" class="x-form-item-body  " id="textfield-1048-bodyEl" colspan="3" style="width: 100%;"><input id="textfield-1048-inputEl" role="textbox" size="1" name="0" class="x-form-field x-form-text" autocomplete="off" data-errorqtip="" style="width: 100%;" type="text"></td></tr></tbody></table>

     

    col2

     

    <table class="x-field x-table-plain x-form-item x-form-type-text x-box-item x-field-default x-hbox-form-item" role="presentation" id="textfield-1053" style="table-layout: fixed; width: 345px; right: auto; left: 352px; top: 0px; margin: 0px;" cellpadding="0"><tbody><tr role="presentation" id="textfield-1053-inputRow" class="x-form-item-input-row"><td role="presentation" id="textfield-1053-labelCell" style="display:none;" halign="left" class="x-field-label-cell" width="105" valign="top"><label id="textfield-1053-labelEl" for="textfield-1053-inputEl" class="x-form-item-label x-unselectable x-form-item-label-left" style="width:100px;margin-right:5px;" unselectable="on"></label></td><td role="presentation" class="x-form-item-body  " id="textfield-1053-bodyEl" colspan="3" style="width: 100%;"><input id="textfield-1053-inputEl" role="textbox" size="1" name="1" class="x-form-field x-form-text" autocomplete="off" data-errorqtip="" style="width: 100%;" type="text"></td></tr></tbody></table>

     

    2nd time

     

    col1

     

    <table class="x-field x-table-plain x-form-item x-form-type-text x-box-item x-field-default x-hbox-form-item" role="presentation" id="textfield-1085" style="table-layout: fixed; right: auto; left: 2px; top: 0px; width: 350px; margin: 0px;" cellpadding="0"><tbody><tr role="presentation" id="textfield-1085-inputRow" class="x-form-item-input-row"><td role="presentation" id="textfield-1085-labelCell" style="display:none;" halign="left" class="x-field-label-cell" width="105" valign="top"><label id="textfield-1085-labelEl" for="textfield-1085-inputEl" class="x-form-item-label x-unselectable x-form-item-label-left" style="width:100px;margin-right:5px;" unselectable="on"></label></td><td role="presentation" class="x-form-item-body  " id="textfield-1085-bodyEl" colspan="3" style="width: 100%;"><input id="textfield-1085-inputEl" role="textbox" name="0" class="x-form-field x-form-text" autocomplete="off" data-errorqtip="" style="width: 100%;" type="text"></td></tr></tbody></table>

     

    col2

     

    <table class="x-field x-table-plain x-form-item x-form-type-text x-box-item x-field-default x-hbox-form-item" role="presentation" id="textfield-1086" style="table-layout: fixed; right: auto; left: 357px; top: 0px; width: 350px; margin: 0px;" cellpadding="0"><tbody><tr role="presentation" id="textfield-1086-inputRow" class="x-form-item-input-row"><td role="presentation" id="textfield-1086-labelCell" style="display:none;" halign="left" class="x-field-label-cell" width="105" valign="top"><label id="textfield-1086-labelEl" for="textfield-1086-inputEl" class="x-form-item-label x-unselectable x-form-item-label-left" style="width:100px;margin-right:5px;" unselectable="on"></label></td><td role="presentation" class="x-form-item-body  " id="textfield-1086-bodyEl" colspan="3" style="width: 100%;"><input id="textfield-1086-inputEl" role="textbox" name="1" class="x-form-field x-form-text" autocomplete="off" data-errorqtip="" style="width: 100%;" type="text"></td></tr></tbody></table>

  6. UniDbGrid was setup with null columns ,and roweditor is true.

     

    when the 1st time click the button to load data,roweditor showed correct,

    from the 2nd time load data ,roweditor shows  wrong like the picture.

     

    and  adoquery(with a sql )  shows same effect (2nd time load data).

     

    What was i missed?

    (test with 1.0.0.1424  and 1.0.2.1442)

     

    post-704-0-86585000-1521035463_thumb.png

     

    test demo

     

    dbgridretest.zip

  7.  

    Hello,
    Something strange is happening when I use the ActionButtons, if it has the Last option, it gives the error of IMG1 when clicking Confirm of RowEditor, and if it is First it gives the error of IMG2

     

    I met this before,and i don't  know why this happend.

    There is a way can by pass this.

    You can try made a useless field with you SQL (like  "select 0 as uselessfield,* from you table"),and made a unvisible  colunm with this field at the 1st position in columns

    Hope you lucky.

     

    Maybe the new beta unigui can solve it

  8. I  modified BMUniDBGrid.pas's codes again.

     

    Before that,I got  an error  - " 'null' is not a valid integer value " when I try to click the roweditor's 'confirm' button ( AcitonColumn and RowEditor are both set  with BMUniDBGrid ) 。

     

    post-704-0-47289200-1518842622_thumb.png

     

    Finaly,I find a way to by pass this error. But I don't know why this is work.

     

    'dataIndex:"0",'

     

    BMUniDBGrid.rar

     

     

  9. Hi Georges

     

    Not yet, mainly beacuse it is in beta stage and can't coexist two versions of UNIGUI, I should tried to do it in a VM. So, it is possible for next week to have a version for uniGUI-ExtJS 5.6

     

    Thanks for ask.

    Hi Bresler, thank you at first!

    Where can i find the last version BMUniDBGrid for unigui 1.0.0.

    And i got "'null' is not a valid integer value." error when i try to use bmunidbrid‘s both actioncolumn and roweditor by click the roweditor's confirm button.

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

×
×
  • Create New...