editor buttons not appearing

editor buttons not appearing

javismilesjavismiles Posts: 205Questions: 38Answers: 3

Hi, I have upgraded editor and datatables to their latest versions and now using this line the editor buttons dont appear

    buttons: [
        { extend: "edit",   editor: eArray[index] }
    ]

this used to work all perfect in previous version

Answers

  • javismilesjavismiles Posts: 205Questions: 38Answers: 3

    strange, I dont get any error message at all, and the code seems to be ok, why would the editor buttons not appear?

        eArray[index] = new $.fn.dataTable.Editor( {
        "ajax": {"url": "admin.php","type": "POST","data": {"etype": obj.table}},
        table: "#"+obj.table,
        fields: fieldobj});
    
    var thetable = $('#'+obj.table).DataTable( {
    

    ......
    order: [ 6, 'desc' ],
    select: {
    style: 'os',
    selector: 'td:first-child'
    },
    buttons: [
    { extend: "create", editor: eArray[index] },
    { extend: "edit", editor: eArray[index] },
    { extend: "remove", editor: eArray[index] }
    ]

    } );
    
  • javismilesjavismiles Posts: 205Questions: 38Answers: 3

    Ive installed the very latest compact js and css files containing
    bootstrap-4.4.1.1, Datatables-1.10.18, Editor-1.7.4 and Jquery-3.3.1

  • javismilesjavismiles Posts: 205Questions: 38Answers: 3

    and inline editing is working, so I can inline edit no problems with this:
    $('#'+obj.table).on( 'click', 'tbody td', function (e) {
    eArray[index].inline( this, {onBlur: 'submit'})});

    but what fails is that the editor buttons just dont appear, help please :)

    buttons: [
            { extend: "create", editor: eArray[index] },
            { extend: "edit",   editor: eArray[index] },
            { extend: "remove", editor: eArray[index] }
        ]
    
  • javismilesjavismiles Posts: 205Questions: 38Answers: 3

    and that worked all fine in previous versions of editor I had, what is the change?

  • javismilesjavismiles Posts: 205Questions: 38Answers: 3

    ok I found the reason, the export of datatables concatenated files didnt include the buttons extension, it works now. However I have this other big issue:

    • In my table I have used this to hide some hidden cells that are used only for calculations:
    • { targets: [1,2,3,4,5,6,8], visible: true},
      { targets: '_all', visible: false }

    problem is that now when using the EDIT button, it includes those hidden fields, i need for those fields to not be included in the edit modal

    also I cannot successfully edit any row because I always get this error connected to the fact that one of my cells gets the info from a mysql VIEW, and for some reason that makes any editing fail,

    An SQL error occurred: SQLSTATE[HY000]: General error: 1471 The target table avgsol of the INSERT is not insertable-into

  • javismilesjavismiles Posts: 205Questions: 38Answers: 3

    we can close this please as we are talking about this on a separate thread , thank u

This discussion has been closed.