# |
Aug 22nd 2019, 11:45 |
alexdd55976 |
@neon1024 i am not getting the whole thing (maybe i read it worng) |
# |
Aug 22nd 2019, 11:43 |
neon1024 |
Anyone have any idea why, when I submit request data array it includes id field, but when the entities are created, they’re marked as new |
# |
Aug 22nd 2019, 11:37 |
admad |
@rchavik if $this->request->getQuery() is empty that problem has nothing to do with crud or search plugin |
# |
Aug 22nd 2019, 11:36 |
neon1024 |
@rhc |
# |
Aug 22nd 2019, 11:33 |
rchavik |
hi, trying to get crud + seach working, but somehow even though requset contains `[REQUEST_URI] => /api/nodes?q=hello`, $this->request->getQuery() in controller is empty. any idea what i'm missing? |
# |
Aug 22nd 2019, 11:33 |
alexdd55976 |
useful, would only use for excessive usage... othewise it might be a bit over the top |
# |
Aug 22nd 2019, 11:32 |
conehead |
Looks promising as well. Thank you |
# |
Aug 22nd 2019, 11:27 |
challgren |
I did use https://github.com/ypnos-web/cakephp-datatables a while ago |
# |
Aug 22nd 2019, 11:26 |
conehead |
@admad @alexdd55976 good gosh. Thanks I guess this solves my problem totally. Not sure why I thought I HAD to use paginator |
# |
Aug 22nd 2019, 11:25 |
slackebot2 |
'%s.salesTotal/%s.salesQuantity', $alias, $alias )), ]); ``` |
# |
Aug 22nd 2019, 11:25 |
mehov |
https://cakesf.slack.com/archives/C053DPNGT/p1566461092003200 Nope, still getting `Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Table.salesTotal' in 'field list'`. Here's what I did: ``` $alias = $query->getRepository()->getAlias(); $query->select([ 'salesTotal' => $query->func()->sum('Table.total'), 'salesQuantity' => $query->func()->sum('Table.quantity'), 'calcPrice' => $query->newExpr(sprintf( |
# |
Aug 22nd 2019, 11:25 |
alexdd55976 |
just replace and remove stuff you don't need and you are good to go |
# |
Aug 22nd 2019, 11:25 |
alexdd55976 |
@conehead here is my code i used to create datatable conform stuff... incl search field |
# |
Aug 22nd 2019, 11:23 |
admad |
@conehead if you don't want the count just dont use paginator, set "limit" and "offset" yourself to teh query |
# |
Aug 22nd 2019, 11:22 |
conehead |
This could be exactly what I am looking for |
# |
Aug 22nd 2019, 11:22 |
alexdd55976 |
no pagination "overhead" |
# |
Aug 22nd 2019, 11:22 |
alexdd55976 |
```$newdata = $query->offset($data['start']) ->limit($length);``` |
# |
Aug 22nd 2019, 11:19 |
alexdd55976 |
try $this->find()->limit(n)->page(m) |
# |
Aug 22nd 2019, 11:19 |
alexdd55976 |
just don'T do this |
# |
Aug 22nd 2019, 11:19 |
alexdd55976 |
´´´$this->paginate = [ 'limit' => 1, 'contain' => [ 'Status', ], ];´´´ |
# |
Aug 22nd 2019, 11:18 |
conehead |
3.8.2 |
# |
Aug 22nd 2019, 11:18 |
conehead |
Or internally |
# |
Aug 22nd 2019, 11:18 |
alexdd55976 |
what cake version u use? |
# |
Aug 22nd 2019, 11:17 |
conehead |
I do not need the count. When I try to paginate, this count query is executed automatically |
# |
Aug 22nd 2019, 11:16 |
alexdd55976 |
for what do you need the count for? |
# |
Aug 22nd 2019, 11:15 |
alexdd55976 |
:face_with_monocle: |
# |
Aug 22nd 2019, 11:15 |
conehead |
That is exactly what I am trying right now. |
# |
Aug 22nd 2019, 11:14 |
alexdd55976 |
and avoids some load on post query pagination |
# |
Aug 22nd 2019, 11:14 |
alexdd55976 |
super quick |
# |
Aug 22nd 2019, 11:14 |
alexdd55976 |
did you think about datatables, combined with ajax calls and json repsonses? |
# |
Aug 22nd 2019, 11:13 |
alexdd55976 |
urgs |
# |
Aug 22nd 2019, 11:13 |
conehead |
Right now it would be just way faster to load 20k entries and throw them at the user than trying to paginate haha |
# |
Aug 22nd 2019, 11:11 |
conehead |
And until now it actually worked quite well. Absolutely not sure if a combined index is the right thing to use here. Just seemed to make sense here |
# |
Aug 22nd 2019, 11:11 |
alexdd55976 |
you don't wanna open this pandoras box |
# |
Aug 22nd 2019, 11:11 |
alexdd55976 |
lol.. don't touch that :) |
# |
Aug 22nd 2019, 11:11 |
alexdd55976 |
oh, ok |
# |
Aug 22nd 2019, 11:10 |
conehead |
Was hoping to switch one day. But as the systems are productive and the ids are stored in thousands of entries and in lots of versioning/history I did not want to switch all |
# |
Aug 22nd 2019, 11:10 |
alexdd55976 |
serious question. |
# |
Aug 22nd 2019, 11:10 |
alexdd55976 |
you sure that a combined index is the way to go there? |
# |
Aug 22nd 2019, 11:09 |
alexdd55976 |
was thinking about uuids .. but seems that uuids would make more sense, if used all over the place and not mixed up |
# |
Aug 22nd 2019, 11:08 |
alexdd55976 |
i have a similar approach planed in my new project |