Editor and bServerSide, Concat and Join questions

Editor and bServerSide, Concat and Join questions

AKM3AKM3 Posts: 9Questions: 0Answers: 0
edited June 2013 in DataTables 1.9
First of all, I 've to say that Datatables + Editor has saved me countless hours of work which I spend reading books or watching interesting movies.
Now to the point:
I was tearing my hair out because I could not find a way to make Editor with bServerSide:true enabled.

And it was a very simple thing:
->process( $_POST )

for :
->process( $_REQUEST )

Since the request is sent by GET when changing order of the columns for example.

One thing I still didn't figured out dear Allan, is a way to make the sort in the server side, and I'm aware of the logic that it should be done either in the client or server side. But as I'm working with thousands of rows of big data, it would be a pleasure to do it on the server.

Another thing I yet didn't figured out, is if there is a way to CONCAT ( day,' ',hour) for example in the editor class (Currently I do it on the client) and also didn't figured out this little thing:

Editor::inst( $db, 'co_acc_logs' )
->pkey('lid')
->fields(
Field::inst( 'lid' ),
Field::inst( 'uid' ),
Field::inst( 'day' ),
Field::inst( 'hour' )
)
->join(
Join::inst( 'co_users', 'object' )
->join( 'uid', 'uid' )
->field(
Field::inst( 'email' )
)
)

Returns co_users.email as a Json object. But how I can do if I want to have this column in the natural fields (Instead of uid I would like to show their email for example )

Anyways, even if I don't know how to use it completely, so far in the latest 2 years has been a great tool! So thank you very much for creating it

Replies

  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin
    > Since the request is sent by GET when changing order of the columns for example.

    The other option is to use sServerMethod in DataTables and set it to 'POST'.

    > One thing I still didn't figured out dear Allan, is a way to make the sort in the server side, and I'm aware of the logic that it should be done either in the client or server side

    This is actually a limitation of the server-side implementation in the Editor libraries at the moment, and it probably isn't going to be a particularly easy one to fix. I've only just realised in the last few weeks, but sorting and filtering on the joined columns simply doesn't work. I haven't yet found a way to resolve this, but I am working on it. I hope to have a fix in Editor 1.3.

    > Another thing I yet didn't figured out, is if there is a way to CONCAT ( day,' ',hour)

    Not in SQL, but you could use mRender in DataTables to display it in a single column (which I presume is what you are looking for?).

    Regards,
    Allan
  • AKM3AKM3 Posts: 9Questions: 0Answers: 0
    Very good answer.
    Thank you very much!

    If you can please add some option to stay on the same page after Inserting or Editing a new row, that I've seen that is a quite popular demand.
    Anyways as you coded the whole thing in a smart way is not hard to model it to your needs :)
  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin
    Agreed - this is something that will be introduced in Editor 1.3.

    Regards,
    Allan
This discussion has been closed.