cancel
Showing results for 
Search instead for 
Did you mean: 

tableView: sort="server" with iterator-generated cell content

daniel_humberg
Contributor
0 Kudos
47

I have an htmlb:tableView that uses an iterator and sort ="SERVER".

In one of the columns, I change the text that is displayed a little bit in RENDER_CELL_START of the iterator.


  DATA lr_text  TYPE REF TO cl_htmlb_textview.
  FIELD-SYMBOLS <fs_row>  LIKE LINE OF me->t_bla.

  ASSIGN p_row_data_ref->* TO <fs_row>.

  CASE p_column_key.
    WHEN 'MY_FIELDNAME'.
      CREATE OBJECT lr_text.
      lr_text->id     = p_cell_id.
      lr_text->text   = me->get_name( <fs_row>-id ).

      p_replacement_bee = lr_text.

Now, if I click on the sort icon of the column, the table is sorted by the field 'MY_FIELDNAME', but not by the actual content of the column.

How would I achieve that?

Accepted Solutions (0)

Answers (1)

Answers (1)

SergioFerrari
Active Contributor
0 Kudos

Hi, maybe you could replace the cell value in the iterator:

DATA: o_table_row TYPE REF TO <ddic structure>.

o_table_row ?= p_row_data_ref.

o_table_row-><column_name> = 'SDN'. "<-- new value

What do you think?

Sergio

daniel_humberg
Contributor
0 Kudos

this sounds almost possible.

I cannot write the new value into the original field of the table though, because I cannot be sure that the datatypes fit to each other and because I stil need the original values.

But I could of course add some more fields to the table structure (which I would not like so much), loop at the table before I use it in the tableView and write the new values into these fields.

Then, I wouldn't even need RENDER_CELL_START at all.