PDA

View Full Version : RowNumberer broekn when used with LiveGridView



ByReaL
9 Jan 2019, 3:03 PM
take the live grid sample/exmaple (gxt-examples/#ExamplePlace:livegrid)
slap on it
RowNumberer<Post> numbererColumn = new RowNumberer<Post>();

and notice the numbers are all over the place, the numbers repeat, it does not look like it's working.

any suggestion ?

Forum_Adm
19 Feb 2019, 1:52 PM
Hello there-

My apologies for the delay in response. I have shared this with support to look into. We appreciate you bringing this to our attention.

Kind Regards,

Michele

ByReaL
15 Aug 2019, 10:21 AM
i did some more tests
added in the data structure a new column called index, and gave it values from 1 to 1000 (added 1000 rows)
if i do like this problem is still there absolutely no change in behaviour
RowNumberer<Post> numbererColumn = newRowNumberer<Post>(new IdentityValueProvider<Post>("index"));
i'm not sure why is not taking the "custom" IdentityValueProvider

ByReaL
15 Aug 2019, 12:31 PM
any idea how to fix it ?
i took RowNumberer.class from GXT in my app i made a file called RowNumberer.java and i'm importing my RowNumberer

i assume the problem is here in those 2 functions:, any suggestion on how to fix it ?



public RowNumberer(ValueProvider<M, M> valueProvider, RowNumbererAppearance appearance) {
super(valueProvider);
this.appearance = appearance;
setWidth(23);
setCellPadding(false);
setSortable(false);
setResizable(false);
setFixed(true);
setHideable(false);
setMenuDisabled(true);
setHeader(appearance.renderHeader());
setCellClassName(appearance.getCellClassName());


setCell(new AbstractCell<M>() {
@Override
public void render(Context context, M value, SafeHtmlBuilder sb) {
RowNumberer.this.render(context, value, sb);
}
});
}

protected void render(Context context, M value, SafeHtmlBuilder sb) {
appearance.renderCell(context.getIndex() + 1, sb);
}