Standalone Collection Editor in form layout?

Standalone Collection Editor in form layout?

NickSiNickSi Posts: 4Questions: 2Answers: 0

Is it possible?
In my case i just want to show data using a form template instead of panels. Does anyone have any examples, there is no need to add, remove or edit the records, just viewing them.

Any help would be much appreciated.

Answers

  • PaulusPaulus Posts: 69Questions: 17Answers: 5

    Simply get the selected row data and display it anyway you want. You do not need the editor. You can add a button to be enabled when a row is selected, with your own label.

    buttons: [
        {
            extend: 'selectedSingle',
            text: 'TODO: Your Label Here!!!',
            className: 'extra-buttons',
            enabled: false,
            action: function (e, dt, node, config) {
                var selectedData = dt.row({ selected: true }).data();
                if (selectedData) {
                    //TODO: Display the DATA
                }
            }
        }
    ]
    
  • allanallan Posts: 63,892Questions: 1Answers: 10,530 Site admin

    @NickSi - Do you mean like in this example but with only a single item?

    Allan

  • NickSiNickSi Posts: 4Questions: 2Answers: 0
    edited May 2017

    Hi,
    I mean exactly that example but instead of panels, i want (if possible)to use the form template from the modal.

    <fieldset class="info">
    <legend>Στοιχεία</legend>
    <editor-field="catnumber"> </editor-field>
    <editor-field="breed"> </editor-field>
    <editor-field="dogname"> </editor-field>
    <editor-field="bek"> </editor-field>
    <editor-field="breeder"> </editor-field>
    <editor-field="class"> </editor-field>
    <editor-field="owner"> </editor-field>
    <ditor-field="birth"> </editor-field>
    </fieldset>
    <fieldset class="evaluate">
    <legend> Αξιολόγηση</legend>
    <editor-field="description"> </editor-field>
    <editor-field="cac"> </editor-field>
    <editor-field="rank"> </editor-field>
    <editor-field="evaluation"> </editor-field>
    <editor-field="bob"> </editor-field>
    </fieldset>
    <fieldset class="thejudge">
    <legend>Κριτής / Judge</legend>
    <editor-field="judge"> </editor-field>
    </fieldset>
    

    http://imgur.com/a/0lgHt

    The purpose is to viewing, filtering and printing multiple records using the form template above.

  • allanallan Posts: 63,892Questions: 1Answers: 10,530 Site admin

    The template can't be reused like the panels in that example, but there is no reason why you couldn't modify the markup in the panels to achieve the layout you are looking for.

    Allan

  • NickSiNickSi Posts: 4Questions: 2Answers: 0
    edited May 2017

    I would like to thank you both for your replies.
    I've tried to modify it, but something i was missing and didn't work.
    However, i did that part without using datatables and editor (which was a big step for me)
    The only problem is that, while the form with the first result is absolutely fine, the next results seems to ignoring some margins and paddings from the form template. I hope i'll find the way googling it.

    Thanks again for your help.

This discussion has been closed.