Keyless and Bubble Edit

Keyless and Bubble Edit

rpmccormickrpmccormick Posts: 139Questions: 19Answers: 0
edited June 2 in Editor

I don't need help, as I have a solution, but this is more of a report about some behavior that kept me busy for a couple hours.

      $edLink = 'RoomStatusEditor.bubble($(\'.progress-description\', this), [\'RoomStatus_Valet\', \'RoomStatus_ValetNote\'], {submitOnBlur: true});';
      $edLink = ' onclick="'.$edLink.'" data-editor-id="'.$grsid.'"';  //Auto lookup current room from booking included below  -  No, MUST use ID...
      $infoCar= '<div'.$edLink.'>'.$infoCar                            // 0 = keyless = doesn't use status below, uses first one on page instead?
              .   '<span style="display:none;" data-editor-field="RoomStatus_Valet">'.$StatusCar.'</span>'
              .   '<span style="display:none;" data-editor-field="RoomStatus_ValetNote">'.$VTNote.'</span>'
              . '</div>';

    //Add Booking_ID to payload
    RoomStatusEditor.on('preSubmit', function (e, data, action) {data.data.Booking_ID = <?=$BookingID?>;});

Basically, I have a situation where I am re-using an Editor for BubbleEdit, but in this case I do not have the ID of the row (I have another ID instead which the API handles fine). The issue is that setting the defaults for the Editor does not work if editor-id=0 (aka: keyless in your json). Now my code gets the ID ahead of time, but I like the API handling it better... if only BubbleEdit didn't ignore my data-editor-fields :( NOTE: The Note is in a different table with the Title="Valet"... I really did some crazy things here using Editor libs, but it all worked out... mostly. This issue does still prevent me from having multiple ValetNote editors in the DOM, as bubble-edits would load the wrong one if done on a Booking that was not yet assigned a GuestRoom (so no RoomStatus_ID exits for the key, so it is 0 and keyless, which all works great except for the UI not using the closest data-editor-field... which also works fine as long as there is only one in a room popup, and not one for every room in the main-page calendar).

Answers

  • rpmccormickrpmccormick Posts: 139Questions: 19Answers: 0

    Here is a screen-shot so my use case makes more sense....

    I first just had Status for each Room in a standard bubble-edit and editor-lib-API. Then I added the Notes thing glued on top of that (for each of 6 status types, each making their own not in the separate Notes DB). Then I made those same functions on Bookings, but still controlling the RoomStatus for the room the guest is checked-in to... which led to this keyless issue. Again, API is 100%, the issues is just the UI for showing current values when BubbleEdit is first opened.

  • allanallan Posts: 64,599Questions: 1Answers: 10,683 Site admin

    Interesting - thanks for posting this. I'll see if I can recreate the issue here and determine if there is something I can do to improve things.

    Allan

Sign In or Register to comment.