Edit single item and bubble editing not working for multiEditable set to false

Edit single item and bubble editing not working for multiEditable set to false

angekoufangekouf Posts: 14Questions: 4Answers: 0

In my datatable I have enabled both bubble editing and editing a single or multiple items after selection with main editing form.

If I disable multiEditable in a field, the field works only when clicking new button.
When I select a single item and click edit the field for which multiEditable has been disabled says that the input can only be edited individually. Is taht normal? Can i specify tomehow to the editing form that only a sinlge element is selected and why do i need to do that since the datatable knows how many elements have been selected anyway?
Even if I try to use bubble editing it says the same, even though bubble editing is by default for changing a single cell. Why?

For now I have left multiEditable enabled to avoid these issus but I would appreciate it if you could point me to the right direction.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    Hi,

    Could you possibly post a link too the page showing the issue please? I'm having trouble picturing this in my mind at the moment!

    Regards,
    Allan

  • angekoufangekouf Posts: 14Questions: 4Answers: 0

    I uploaded the page. http://tests.southcrete.gr/office/contacts
    I have disabled multiEditing for email. Try to use bubble edit or select an item and edit it.

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    Thank you. This is a bug for certain. I'm tracking it down just now and will send you an updated file with the fix tomorrow morning.

    Regards,
    Allan

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    Apologies, I've not been well today and haven't been able to work on the fix. I will have it done tomorrow for sure and send it over then.

    Allan

  • angekoufangekouf Posts: 14Questions: 4Answers: 0

    Ok. Thank's a lot. Hope you get better soon. :smile:

    Soory to impose, but could you also tell be why the datepicker does not show in 'Date of Birth' field when clicking new or edit, but works porperly on bubble editing?

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin
    Answer ✓

    Thanks - feeling much better today :smile:.

    I've just sent you a PM with an updated version of Editor that should resolve this issue. for multi editing.

    why the datepicker does not show in 'Date of Birth' field when clicking new or edit

    It looks like a z-index issue. The modal is on top of the date picker. If you use:

    div.editor-datetime {
      z-index: 11001;
    }
    

    in your CSS, that will resolve that issue.

    Allan

  • angekoufangekouf Posts: 14Questions: 4Answers: 0

    Thank you allan. Everything works properly now.
    I knew the datepicker was something idiotic on my part but could not figure out what... :blush:
    Thanks a great deal for your help.

  • sliekenssliekens Posts: 97Questions: 17Answers: 2

    Allan, could you share the fix? I'm also having problem getting fields.multiEditable to work.

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    I've just sent it over via PM. I'll be doing an Editor release next week with all the latest fixes.

    Allan

  • FlashdownFlashdown Posts: 20Questions: 3Answers: 0

    Looks like it's still not fixed in 1.6.2
    Can I have the fixed version, please?

  • FlashdownFlashdown Posts: 20Questions: 3Answers: 0

    I just noticed an odd piece of code, could you please check if that's a bug:

        isMultiValue: function () {
            return this.s.multiValue && this.s.multiIds !== 1;
        },
    

    Shouldn't it be this.s.multiIds.length ?

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    Yes - I believe you are correct. I'll run some tests on that shortly, but I think it should be.

    Does it work for you locally if you make that change (I'm not at my dev machine at the moment).

    Regards,
    Allan

  • FlashdownFlashdown Posts: 20Questions: 3Answers: 0
    edited April 2017

    Unfortunately, it doesn't solve the issue, so I'm still looking forward to getting a fix from you.

  • FlashdownFlashdown Posts: 20Questions: 3Answers: 0

    After upgrading to 1.6.2 I'm also running into an issue with the submit: 'changed' option, it doesn't seem to be working; the form submits the values which even weren't touched.

  • FlashdownFlashdown Posts: 20Questions: 3Answers: 0

    I had to downgrade to 1.6.1 which did the trick, but still don't know what to do with the multiedit issue.

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    Are you able to give me a link to a test case showing that issue please? This example uses submit: 'changed' and it appears to work as expected.

    Thanks,
    Allan

  • FlashdownFlashdown Posts: 20Questions: 3Answers: 0
    edited April 2017

    Here you are:
    http://live.datatables.net/mosubezi/1/

    Click on the empty space in the last column, input some value and click outside the field, and keep track of the AJAX request. You'll notice that the value of the second column is also submitted though it was not edited.
    Please notice that the issue doesn't exist in 1.6.1

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    Hi,

    Fantastic - thanks for the test case!

    The issue is being caused by strict type checking. In the data being loaded from the server the price values are Number types (e.g. 10.5), while when Editor reads then back from the input element it reads them as a string (e.g. "10.5").

    1.6.1 didn't do strict type checking, but 1.6.2 does, which means that these values appear to be different and hence why they are submitted. If you change price1_value to be a string ("price1_value": '10.5',) it will submit only price2 as expected.

    You can restore the loose type checking by finding:

    else if (o1[propName] !== o2[propName]) {
    

    in the Editor source and changing it to be:

    else if (o1[propName] != o2[propName]) {
    

    I'm honestly not sure if I consider this to be a bug or not! The data is different, so technically it is correct, but I can also see that it might be unexpected.

    I'll have a think about it!

    Regards,
    Allan

  • FlashdownFlashdown Posts: 20Questions: 3Answers: 0

    Thanks for looking into that.
    In this case it would make sense to explicitly point out in the docs that the data returned from the server should be in the text format.

    Were you able to reproduce the issue with multi-editing or it works fine for you?

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    Sorry I must confess I lot track of that one. I've added it to my log to look into it now and will get back to you.

    Allan

  • sliekenssliekens Posts: 97Questions: 17Answers: 2

    Allan, the issue with fields.multiEditable still exists in Editor 1.6.3.

    Instead of trying to get the community to submit code that doesn't work, could you please create an example with code that does work as intended?

  • sliekenssliekens Posts: 97Questions: 17Answers: 2

    Here's an example of multiEditable that doesn't work: http://live.datatables.net/yozotoyi/2/edit?js,output

    Select a row and click the Edit button. Observe that First Name and Last Name are incorrectly disabled.

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    My apologies - yes, there is a bug there. Thank you for the test case. I fear I might have inadvertently added that in 1.6.3. Same result, different cause and I missed it.

    Allan

  • sliekenssliekens Posts: 97Questions: 17Answers: 2

    No problem. Will it be in the next release? It's one of our most wanted features because we have many tables with unique constraints.

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    Yes it will be. I'm also going to add an example to the live examples list. I'm not sure when 1.6.4 will be released yet, but I'll update this thread when its done.

    Allan

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    Quick update - this has been committed now and the multi-row editing example updated to include use of fields.multiEditable. 1.6.4 will short in the next couple of days.

    Allan

  • frenkie.smartfrenkie.smart Posts: 1Questions: 0Answers: 0

    Hi allan

    I just tried V1.6.4, 1.6.5 and also the latest, but the error seems to exist. And also on the latest version, which is 1.9.1.

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    Hi @frenkie.smart. Could you give me a link to a page showing the issue please? It appears to work in this example.

    Allan

This discussion has been closed.