Jump to content

UniDbgrid roweditor was drawing at wrong position


Recommended Posts

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

Link to post
Share on other sites

Workaround:

procedure TMainForm.UniFormCreate(Sender: TObject);
var
  i:integer;
begin

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


  for i := 0 to 15 do
  begin
    self.ClientDataSet1.FieldDefs.Add('X'+inttostr(i),ftString,50,False);
  end;
  ...
Link to post
Share on other sites

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>

Link to post
Share on other sites

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') );
Link to post
Share on other sites

 

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

Link to post
Share on other sites
  • 9 months later...

dbgrid_forcefit.thumb.png.dba415860a8b78fe95f5c62fe429b4be.png

1.70.0.1485

unidbgrid.forcefit=true

 2 null fieldname columns ,visible are false

No css code,No clientevent code.

if set forcefit false,nothing looks strange.

 

I guess the reason are

unidbgrid.forceit=true     +   column.visible=false

Link to post
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...