Jump to content
uniGUI Discussion Forums
Sign in to follow this  
zhyhero

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

Share this post


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

Share this post


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>

Share this post


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') );

Share this post


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

Share this post


Link to post
Share on other sites

Sorry ?

 

My App dynamic Create all  dataset fields, columns and  editors(Tuninumberedit for real number)。

So I try this test,and found this。

Share this post


Link to post
Share on other sites

Hi,

 

Finally, I give up to use roweditor……

Sorry, can you make a simple testcase for your issue?

 

Best regards,

Share this post


Link to post
Share on other sites

I have the same issue, when I assign a control as editor in column propertios then the roweditor draw wrong width!

Share this post


Link to post
Share on other sites
3 hours ago, mhmda said:

I have the same issue, when I assign a control as editor in column propertios then the roweditor draw wrong width!

Hi Mohammad,

Which build are you using? How can we reproduce this?

Share this post


Link to post
Share on other sites

We use: 1.50.0.1483

RE.gif

 

REG.gif

 

Do you know why this happen?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Well, I don't have hidden columns and 'ForceFit' is set to false.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×