Editing a same cell on diferent rows with Editor edit.

Editing a same cell on diferent rows with Editor edit.

ChemonChemon Posts: 19Questions: 0Answers: 0
edited January 2013 in General
Hi all,

When we use Editor and we have multiple row selector, if we select 2 or more rows, EDIT button is disabled.
I would like it wont be disabled. I would like to get the edit window showing info about the number of selected rows we are going to edit.
And the user can select what cells he want to change to give same value for all of the selected rows.

I want to find a good solution for this thing, when aplication user need to change same cell on diferent rows. The excell tool isnt good because we could have the case of unordered selected rows. So is more suitable and practical, just select the rows and click edit.

Maybe a good way would be add check boxes on the fields of the edit window when u go to edit more than 1 row currently. So u can select what field with same value u want to change on these rows.

I think this need is given on many proyects and a cool solution/idea would be great for all people using datatables.

Ty and congrats.

PD: Sorry if my english isnt good.

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Hi,

    Currently multi-row editing isn't possible in Editor. It is something that I will be looking at adding in future, but its a significant challenge in terms of how it is presented to the end user (the technical part is not difficult). For example, lets say I want to edit 3 rows with a text field which has the values 'a', 'b' and 'c' in each of the rows. How would you present to the end user that there are three different values? Let's say they didn't want to edit that field, but rather a different one and leave the current values as they are, rather then setting them all to the same new value.

    Most likely the way I'll attempt to tackle this is by a more 'inline' approach - letting the user pick which cells to edit. But that might be a few version of Editor away yet I'm afraid!

    Allan
  • ChemonChemon Posts: 19Questions: 0Answers: 0
    edited January 2013
    [quote]allan said: For example, lets say I want to edit 3 rows with a text field which has the values 'a', 'b' and 'c' in each of the rows. How would you present to the end user that there are three different values?[/quote]

    [quote]Chemon said: Maybe a good way would be add check boxes on the fields of the edit window when u go to edit more than 1 row currently. So u can select what field(s) with same value u want to change on these rows.[/quote]

    A simple and good way to implement isnt hard.
    U can write the value on the field of the editor window if all fields(cell, column) of the selected rows of the table are equal.
    Or u can write the most given value of all the selected rows.
    Or u can give a input box to write a new one and a html select with all the selected rows value and "-new-" value to select in case u want to write a new value that u will write on the input box. ( this last example can be a bit more hard to implement ).

    To finish u add a "checkbox" for each field on the editor window. To u can check what field(s) u want to update with new values, to dont override other values u dont want to change.

    So, for example, u want to change the 2nd column of some diferent rows, u select the rows, u click edit button, then u get the edit window. U check the checkbox for field 2 ( column 2 ) and u write the new value on an input text.
    Accept and done.


    I dont know how to implement it, maybe i am wrong, but it doesnt look hard,

    When u click on edit, u check how many selected rows there are.
    If there are more than 1, show a text msg to the user "U are going to edit/update X amount of columns"
    This is important because when user want to edit 1 row, he could have leaven other selected rows that he doesnt see, remember and he could edit these rows too, when he doesnt realy want to edit them.

    So we have to show the msg, and the checkboxes ( to select what fields we want to edit ) + input ( other types ) fields.

    Is this hard Allan ?
    Ty
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Not massively hard - no :-). It would require few modification of course, but I'm not a massive fan of the interface that would present to the end user. It would show more controls than are strictly required, and thus end up confusing end users. You might also run into issues when you have 1000 rows in a table and you select all rows and then try to edit them - that s a huge list of options for each field (of which there may be many).

    As I say, I don't think the technical problem is that difficult - the challenge is how to present it to the end user, and I'm not yet certain what the best way forward is with that. It is however something that is on the Editor roadmap to work on - after DataTables 1.10 :-)

    Allan
  • ChemonChemon Posts: 19Questions: 0Answers: 0
    [quote]allan said: You might also run into issues when you have 1000 rows in a table and you select all rows and then try to edit them - that s a huge list of options for each field (of which there may be many).[/quote]

    And how would u edit one field of 200 rows without any criteria ( so u cant filter ) from a table with 500 rows ?
    For example, u have to change section field ( column ) for some random products of the products table.
    How would u do it right now ? one by one ? o.o

    I would like to find a good solution for this kind of problem.
    Or please some info about how to implement editor to in case of enduser goes to edit more than 1 row, editor window shows a checkbox for each field to enduser can select what field(s) want to update.
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Currently yes you would need to. As I say, its a limitation in Editor that will be corrected in future!

    One option at the moment is to use the Editor API to make a call to the server to update all rows (use the `edit` method), but that would require an Ajax call for every row.

    Other options would require modifications to Editor.

    Allan
  • ChemonChemon Posts: 19Questions: 0Answers: 0
    [quote]allan said: Other options would require modifications to Editor.[/quote]

    What modifications ? hard modifications ?

    I just want
    select more than 1 row
    edit still enabled to be able to open editor
    open editor with checkboxes for each field
    Maybe fields could variate, maybe not. Still have to think a bit more about. Busy now, will edit post after.

    Ty Allan.
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    > What modifications ? hard modifications ?

    I don't know exactly what modifications or I'd put them into the product :-). I suspect there is a fair bit of work there.

    Fundamentally Editor does not currently support multiple simultaneous edits at this time. It is a roadmap feature.

    Allan
  • ChemonChemon Posts: 19Questions: 0Answers: 0
    edited January 2013
    Ok, i got it Allan. Ty.

    So any other solution to fix this need ? i must implement to enduser has an easy and suitable way to support multiple simultaneous edits ?
    Shot Allan, :), u must have some good idea.

    I thought about adding an extra column with a checkbox, to enduser can check the rows he need, then filter by that checkbox column, he gets only the rows he want to change and now he can change them with edit + save_before/next plugin. But this way still sux. because he must rewrite each field for each row. and click next. acept. ...

    Maybe adding excell option combined with a filter by multiple selected rows, to we dotn have to add a new column with the checkbox. What do u say ? This looks not bad.

    EDIT: Just noticed i would have to variate the action for Autofill, to it just copy the first value on the other cells in same column. Not increasing 1, 2, 3, 4. ...., just 1, 1, 1, 1
    And cells should be editable to enduser be able to write the value he wants to copy on that column.
This discussion has been closed.