Menu

SuietASSURED Banner

Save

Save

Welcome, Guest
Username: Password: Remember me

TOPIC: Changing the functionality of the inline edit.

Changing the functionality of the inline edit. 4 days 22 hours ago #57996

  • d3vnu77
  • d3vnu77's Avatar
  • Offline
  • New Member
  • Posts: 10
  • Karma: 0
When you click away from the inline edit without clicking the checkmark, you get a javascript popup that says:

You have clicked away from the field you were editing without saving it. Click ok if you're happy to lose your change, or cancel if you would like to continue editing "THE FIELD"?

Is it possible to make the field save instead when clicking away?

Secondary, it would also be benefital to my application to be able to tab to the next field saving the field upon each subsequent tab.

Is this possible?
The administrator has disabled public write access.

Changing the functionality of the inline edit. 4 days 8 hours ago #58021

  • pgr
  • pgr's Avatar
  • Offline
  • SuiteCRM Is My Life
  • Posts: 3537
  • Thank you received: 570
  • Karma: 135
This is where the code is:
include/InlineEditing/inlineEditing.js:316:                var r = confirm(SUGAR.language.translate('app_strings', 'LBL_CONFIRM_CANCEL_INLINE_EDITING') + ' ' + message_field);

So you can try adapting it to your needs by customizing.
Last Edit: 4 days 8 hours ago by pgr. Reason: add code tags
The administrator has disabled public write access.
The following user(s) said Thank You: d3vnu77

Changing the functionality of the inline edit. 4 days 1 hour ago #58038

  • d3vnu77
  • d3vnu77's Avatar
  • Offline
  • New Member
  • Posts: 10
  • Karma: 0
Cool. I was able to add the functionality I wanted. If anyone else is interested here is what i did:

To save and move to the next tab (when pressing the tab key), I added this to the bottom of the validateFormAndSave function
$(document).keydown(function(e) {
        if (e.which == 9 && !e.shiftKey) {
            $inlineEdits = $('div.inlineEdit');          
            e.preventDefault();
            $("#inlineEditSaveButton").click();
            $tabNext = false;
            $inlineEdits.each(function (index, value)
            {
                if($tabNext == true) { $(value).dblclick(); }
                if($(value).hasClass('inlineEditActive')) { $tabNext = true; }
            });
        }
    });

To remove alert and save when clicking out I change the $(document).on('click', function (e)
if (alertFlag) {
              e.preventDefault();
              $("#inlineEditSaveButton").click();
            } else {
Last Edit: 4 days 1 hour ago by d3vnu77.
The administrator has disabled public write access.

Changing the functionality of the inline edit. 3 days 14 hours ago #58050

  • pgr
  • pgr's Avatar
  • Offline
  • SuiteCRM Is My Life
  • Posts: 3537
  • Thank you received: 570
  • Karma: 135
Hey thanks for posting that code. Did you get it working under the "custom" directory? Just trying to make sure it's upgrade-safe.

Another question: is that "save and move focus" code something you think should be added to SuiteCRM?
The administrator has disabled public write access.
Time to create page: 0.045 seconds
Powered by Kunena Forum