Editor Problem after adding a row... and how to "leftjoin" data serverside?

Editor Problem after adding a row... and how to "leftjoin" data serverside?

svrsvr Posts: 23Questions: 0Answers: 0
edited March 2014 in DataTables 1.8
could someone please take a look whats wrong with this setup? trying to get it work...
http://debug.datatables.net/ecaxux



data is saved to database. json seams to be wrong format but why? how could i look it up?

i added
aoColumnDefs: [
{
sDefaultContent: '',
aTargets: [ '_all' ]
}
],
as i found in another thread here... but this just lets the added row appear in the dom not at reload...

also i changed one column in sql, .js and html table... are there other files to change if the columns change?


SECOND QUESTION
i would like to get a additional selectbox containing ID's and MAKE-NAME from another mysql table to let the user select a MAKE out of MAKES.sql at "NEW" form providing a select box with all MAKES ... so he is able to select the current available makes. the ID of that selected MAKE should be saved to the entry he tries to add. hopefully you understand that szenario... basically combining two .sql tables into one. how do i do it?

thanks for any help...

Replies

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin
    Hi,

    I'm afraid I think I would need to be able to see the JSON return from an edit event to be able to understand what is going wrong there. Are you able to PM me a link?

    Regarding the left join question, although it is possible in Editor 1.2 with the Join class, I've done some work recently introducing a new `leftJoin()` method into Editor 1.3 which makes this kind of thing massively easier! Can I e-mail you a beta of Editor 1.3 through to the e-mail address you used to sign up with?

    Thanks,
    Allan
  • svrsvr Posts: 23Questions: 0Answers: 0
    yes please... i will give it a try. thank u very much... rest up via pm...
  • mschroeder55409mschroeder55409 Posts: 4Questions: 0Answers: 0
    Allan,

    I would love to get the Editor version with a leftJoin() method as well. Also, I'm struggling using Editor for more complex queries that include not only left joins but WHERE clauses on the joined tables, i.e.

    select a.col1, b.col2 from a left join b.col1 on a.col1 WHERE b.col2='someValue'

    (depending on the user_ID the WHERE clause may or may not be included)

    Currently, the Editor/join class doesn't seem to support this. It's running each table separately at the database and returning the results to the client where it then "joins" the tables. Therefore, the WHERE clause on lookup (table b) tables isn't carried through to the main (table a) table.

    Any direction on this would be greatly appreciated.

    Thanks!

    Mike
  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin
    @svr - e-mail coming your way with the beta shortly.

    Regarding the link - thanks for that! There is currently a JS error on the page, due to:

    [code]
    "aoColumns": [
    ,
    [/code]

    in your table initialisation. It makes DataTables think there is 10 columns, when in fact there is 9.

    @mschroeder55409 - Could you PM me an e-mail address (or is it just the one you used to sign up with?) and I'll fire over the beta which is able to cope with that kind of statement.

    Allan
This discussion has been closed.