save-button shows only on change, not on new line (inline)

save-button shows only on change, not on new line (inline)

MadMax76MadMax76 Posts: 108Questions: 21Answers: 0

Hi,

I have a "save-button" defined like this:

            editor_pos.inline(table.cells(this.parentNode, '*').nodes(), {
                submitTrigger: -1,
                submitHtml: '<i class="fa fa-save" style="font-size:24px;"/>'
            });

Thsi only shows when changing a line in inline-mode. I need this button also for new lines.

I tried this:

    { extend: 'create',
                    text: 'Neu',
                    **submitHtml: '<i class="fa fa-save" style="font-size:24px;"/>',**
                    action: function () {
                        editor_pos.inlineCreate();

                        //      var row = table.row({selected: true}).data();
                        var rowlast = table.row( ':last-child' ).data();

                        var fields = editor_pos.displayed();

                        for (var i=0 ; i<fields.length ; i++) {
                            //          editor_pos.field(fields[i]).val(row[fields[i]]);
                            editor_pos.field(fields[0]).val(rowlast[fields[0]]*1 + 1);  } } },

but this does not work.

Thanks
Max

Answers

  • allanallan Posts: 53,929Questions: 1Answers: 8,403 Site admin

    Hi Max,

    Do you mean you want to replace the standard "Save" text in the modal button with a font-awesome icon? If so, use the i18n.create.submit option and set it to be your <i> tag.

    Allan

  • MadMax76MadMax76 Posts: 108Questions: 21Answers: 0

    no, I do not want to change a text - I have this icon wfhen editing a row:

    But this does not show when creating a new line:

    Thanks
    MAx

  • allanallan Posts: 53,929Questions: 1Answers: 8,403 Site admin

    How are you triggering the inline create action? If you have a look at this example you'll see that I use submitHyml and submitTrigger for the formOptions for the button. That might be what is missing here?

    Allan

Sign In or Register to comment.