Editor 1.2.4 and expected date for version 1.3

Editor 1.2.4 and expected date for version 1.3

AKM3AKM3 Posts: 9Questions: 0Answers: 0
edited October 2013 in Editor
Dear Allan, question:

Editor @version 1.2.4 does not have the lib/php files inside ?

Or it's me that I'm missing something ?

In another topic, is there any expected date for the new version to come ?

I would love that in the new version there is a way to do more specific queries. For ex. more complex joins and where in (value,value) things alike that are the moment are hard to achieve. Of course I understand that Editor has a limit and then you can code your own Json response. But it will be really handy to have some more options.

So far, after 2 years of use, I can tell you that is a pleasure to use !

Replies

  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin
    Hi,

    > Editor @version 1.2.4 does not have the lib/php files inside ?

    I've just downloaded the package and it does appear to have them - in `examples/php/lib` .

    > In another topic, is there any expected date for the new version to come ?

    Editor 1.3 is expected in December or January and will feature a new bubble editing mode, an improved API, full integration with DataTables 1.10 and hopefully the ability to work with more complex joins (although this is something that I'm still investigating how best to implement).

    > So far, after 2 years of use, I can tell you that is a pleasure to use !

    Excellent to hear - thank you!

    Regards,
    Allan
  • AKM3AKM3 Posts: 9Questions: 0Answers: 0
    Ah yeah! Right, found it, thanks.

    As a summary I see that:
    + a function to use table aliases has been added.
    + there is a new whereSet to see if the Where conditions are also included in Create and Update (false by default, I was doing it after editor so I guess now it will be simpler)
    + data function changed a bit for the Join function, now the where is performed before the join
    + in the remove function there is a where_group that is new and still didn't get exactly what it does

    Only checking code I still didn't tested it but looks like a cool upgrade!
    Thanks for your answer.
  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin
    Full release notes are available here: https://editor.datatables.net/download/release-notes-1.2.4 - although I've not documented the database class changes you noted :-). It is possible that I might change them come 1.3, although I think probably unlikely. I just didn't want to publicly announce them as features yet!

    Allan
  • AKM3AKM3 Posts: 9Questions: 0Answers: 0
    edited November 2013
    Thanks Alan!
    I'm looking forward next version of Editor. This is exactly what I need for the future, since as today I'm still using a combination of Editor + Jeditable in some parts.

    But I need to use only one technology in order not to grow more gray hair and deliver more profesional usability to my applications. So the bubble editing mode can be the greatest solution of all.

    Or something like edit and all the row is transformed into editable mode, like phpmyadmin this days, but in a nicer datatables way. Sounds like a dream.
  • matolamatola Posts: 23Questions: 6Answers: 1
    Allan, could you please provide an example on the usage of whereSet() php method?
  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin
    It should be as simple as adding: `->whereSet( true )` to your Editor instance. It only accepts a boolean value: https://editor.datatables.net/docs/current/php/class-DataTables.Editor.html#_whereSet .

    [code]
    Editor::inst( $db, 'browsers' )
    ->fields(
    Field::inst( 'engine' )->validator( 'Validate::required' ),
    Field::inst( 'browser' )->validator( 'Validate::required' ),
    Field::inst( 'platform' ),
    Field::inst( 'version' ),
    Field::inst( 'grade' )->validator( 'Validate::required' )
    )
    ->where( 'browser', 'Chrome' )
    ->whereSet( true )
    ->process( $_POST )
    ->json();
    [/code]

    It won't work with more complex expressions such as `<` and `>` which is part of the reason it isn't fully documented at the moment!

    Regards,
    Allan
  • matolamatola Posts: 23Questions: 6Answers: 1
    Thank you for your swift answer.
    In the documentation I have there should be an operator in:
    ->where( 'browser', 'Chrome' )
    i.e.
    ->where( 'browser', 'Chrome', '=' )
    or am I wrong?

    I get JSON error when I add ->whereSet( true )
    and if I don't I cannot create/add a post.
  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin
    > In the documentation I have there should be an operator in [...]

    Its optional. If not given, then it will default to `=` :-)

    > I get JSON error when I add ->whereSet( true )

    What is being returned from the server that is making it invalid JSON?

    Allan
  • matolamatola Posts: 23Questions: 6Answers: 1
    edited December 2013
    Datatables says "Loading" and I get an alert about JSON formatting error.
    Is there a simple way to trap the info your are requiring? I.e. what is being returned from the server?
    When I remove the ->whereSet( true ) all is fine.
  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin
    > Is there a simple way to trap the info your are requiring? I.e. what is being returned from the server?

    Right click on the page, and select "Inspect element". Then reload the page and look at the "Network" tab in your browser. There will be an XHR (Ajax) request. Click on it and it should show what the error is - I hope!

    Another option is to try the debugger ( http://debug.datatables.net ).

    Allan
  • matolamatola Posts: 23Questions: 6Answers: 1
    edited December 2013
    Editor::inst( $db, 'mmvls_komp' )
    ->fields(
    Field::inst( 'org_id' ),
    Field::inst( 'kompetens' )
    ->validator( 'Validate::required' ),
    Field::inst( 'namn' )
    ->validator( 'Validate::required' ),
    Field::inst( 'anstnr' ),
    Field::inst( 'expdate' ),
    Field::inst( 'iup' )
    )
    ->where( "org_id", "maltest" )
    ->whereSet( true )
    ->process( $_POST )
    ->json();

    The server reports:
    Fatal error: Call to undefined method DataTables\Editor::whereSet() in C:\wamp\www\devvls\php table.mmvls_komp.php on line 33.

    It appears that the whereSet() is not present in Editor.php (the one included with Generator). So I downloaded the latest and now it seems to work.
  • aaronwaaronw Posts: 89Questions: 3Answers: 4
    Any further update on a release for 1.3? We already purchased Editor and I'm going through and refactoring some old code that did not use editor to use editor instead and I'd rather not download and code for 1.2.4 if 1.3 +1.10 have some useful new API features. e.g, what is 'bubble editing'?
  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin
    Not yet - late January is the target for Editor 1.3 now since DataTables 1.10 is taking a long time to write the documentation for. It will be backwards compatible, so refactor away to the current Editor code base - the new features will be relatively simple to add if you want them.

    Bubble editing is a bit line inline editing, but its done in a little popup bubble, so it doesn't have any of the reflow issues that inline editing does, but has all the same advantages.

    Allan
This discussion has been closed.