Error message "Not unique table\/alias:" - Page 2

Error message "Not unique table\/alias:"

2»

Answers

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin

    Can you link me to the page so I can take a look please?

    The number of columns defined in the columns option should exactly match the number of columns in the HTML for the table.

    Allan

  • pzh20pzh20 Posts: 66Questions: 15Answers: 0

    it's on my machine, localhost. not possible.

    Pete

  • pzh20pzh20 Posts: 66Questions: 15Answers: 0

    if I inspect the th element it shows

    <th class="sorting" tabindex="0" aria-controls="hourstable" rowspan="1" colspan="1" aria-label="

                        : activate to sort column ascending" style="width: 46px;">
    
                        </th>
    

    Regards
    Pete

  • pzh20pzh20 Posts: 66Questions: 15Answers: 0

    Fixed it! It was my fault, the HTML had an error. Sorry.

    Now all I need to be able to do is reload the table on change of a form field.

    Regards
    Pete

  • pzh20pzh20 Posts: 66Questions: 15Answers: 0
    edited March 2015

    It seems the ajax.reload() doesn't POST variables as defined in the data: section of the original load.

    How can I pass it the changed variables?

    Regards
    Pete

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin

    You need to use ajax.data as a function:

    data: function ( d ) {
      d.bu = $("#bu").val();
      d.wkend = $("#weekendingdate").val();
    }
    

    Do the same for Editor.

    See ajax.data and ajax.data for further information.

    Allan

  • pzh20pzh20 Posts: 66Questions: 15Answers: 0

    Sorry, not sure I understand, as part of the reload?

    $('#bu').change(function(){
    table.ajax.reload();
    });

    Can I use it here?

    Pete

  • pzh20pzh20 Posts: 66Questions: 15Answers: 0

    Ok, got it.

    Once again, thanks so much for your help. I thnk I can close this one now.

    Regards
    Pete

  • pzh20pzh20 Posts: 66Questions: 15Answers: 0

    Oh no, not quite. It seems that I cannot edit a record. I click update and the record returns to it's original state.

    If I try in-line editoring, the record disappears!

    Is there somethign that logs the update process?

    Regards
    Pete

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin
    Answer ✓

    The first place to look is in your browser's developer tools. Specifically the "Network" option so we can see what data is submitted on edit and what data is returned.

    Allan

  • pzh20pzh20 Posts: 66Questions: 15Answers: 0

    Allan,

    Is there a way to exclude certain fields from being updated, both on the front end, so the user cannot change them, or via the update query?

    What has happened is the date of the record changed from the weekending date to the current date, so it seems to disappear when it's date had just changed.

    Regards
    Pete

  • pzh20pzh20 Posts: 66Questions: 15Answers: 0

    Allan,

    or, can I update the record with data from the form but not in the datatable?

    Regards
    Pete

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin
    Answer ✓

    Is there a way to exclude certain fields from being updated, both on the front end, so the user cannot change them, or via the update query?

    Remove them from the form with the clear() method. You can then add new fields, if you need to, using add().

    What has happened is the date of the record changed from the weekending date to the current date, so it seems to disappear when it's date had just changed

    That sounds like a MySQL gotcha. Are you submitting a value for that date field?

    Allan

This discussion has been closed.