datatable as input
datatable as input
Lapointe
Posts: 430Questions: 81Answers: 4
in Bug reports
Hi
I thinks there is a bug in datatable as input.
When updating content,
Editor.field('DtAsInput').update( JSON );
if no option append set update append data to existing,
Editor.field('DtAsInput').update( JSON, true );
works for replace content...
Bob
This question has accepted answers - jump to:
This discussion has been closed.
Answers
DataTables 1.10.24
Editor 2.0.1
Thank you - it’s something I’ve got fixed in the 2.0.2 dev version and will be release as 2.0.2 this coming week.
Allan
Hi Allan
Thanks for that
Today is sunday (in France).
Just a question. I need to set some sql statement as
Can you please help me to use the correct db-> function to do this and get data of course
For the inverted append flag, can you please tell me the code line to invert (else I'll have to change settings for many src files when 2.0.2 will come)
Thanks again
Tomorrow... Monday... For me working days are m to s included
Bob
Hi Bob,
Inside the
_addOptions(conf, options, append = false) {
function for thedatatable
type you will find:It should be:
For your SQL statements, can you remind me if you are using PHP or .NET - I can't remember I'm afraid. In either case though, I think for a more complex statement like that, you'd be best to use whatever database libraries you already have. For example in PHP you'd use the PDO object (which you can get from Editor's database libraries using
$db->resource()
.Allan
Hi @allan
Thanks for that...
I use php, and find some stmt->prepare in your source code, but you have the complete db schema in mind, me not really (perhaps in 10 years ?)
So if you can direct me using $db nor external connection declaration, it should be easyer to maintain.
Thanks again.
PS datatable as input just open amazing ways to UI.
Bob
Hi Bob,
If you want to try using the PHP SQL abstraction library that we use in the Editor PHP libraries, they are fully documented here.
You'll see there are methods such as
->insert()
and->update()
for the basic SQL cases, and it makes that kind of thing a lot easier (imho). But for more complex statements, you will either want to do a raw query (->sql()
) or use the PDO connection directly (->resource()
).Allan