Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 14 18:25
    stokkeland opened #799
  • Sep 13 19:34
    skiliton commented #415
  • Sep 12 15:34
  • Sep 12 06:01
    abbadon1334 commented #438
  • Sep 11 19:38
    DarkSide666 commented #450
  • Sep 11 19:38
    DarkSide666 commented #450
  • Sep 11 19:37
    DarkSide666 commented #450
  • Sep 11 19:35
    DarkSide666 unlabeled #450
  • Sep 11 19:30
    PhilippGrashoff commented #418
  • Sep 11 19:29
    PhilippGrashoff closed #449
  • Sep 11 18:21
    DarkSide666 labeled #450
  • Sep 11 18:20
    DarkSide666 commented #450
  • Sep 11 18:09

    DarkSide666 on change-containsone

    (compare)

  • Sep 11 18:07
    DarkSide666 labeled #450
  • Sep 11 18:07
    DarkSide666 assigned #450
  • Sep 11 18:02

    DarkSide666 on add-defaults-unit-test

    (compare)

  • Sep 11 18:02

    DarkSide666 on develop

    Add Unit test cases for field d… (compare)

  • Sep 11 18:02
    DarkSide666 closed #458
  • Sep 11 17:53
    codecov[bot] commented #458
  • Sep 11 17:50
    codecov[bot] commented #458
PhilippGrashoff
@PhilippGrashoff
that will render the input as read only
but only a hack
please submit an issue in atk ui
Thomas Stokkeland
@stokkeland
yes i understand - thank yoy
i will do that
Thomas Stokkeland
@stokkeland
submitted atk4/ui#799
Thomas Stokkeland
@stokkeland
i like to design a concept of main "parent" form, tied to a DB model. Then use addAction on a form field, that opens a modal view with a non-model-tied-form (child form), when that child form is saved it closes the view updates the value of a field of the "parent" form - without saving to DB.. i take it that has to be either some javascript carried values, or some finicky page load of sort.. i can get the forms just fine but not sure what best aproach is for carrying the values back - is there a mechanism for it somewhere?
i am reading through https://agile-ui.readthedocs.io/en/latest/js.html - guessing i have to do it with js - still trying to get a grasp of everything i should do the atk way vs "traditional"
PhilippGrashoff
@PhilippGrashoff
As the value shouldn't be saved, I'd go for Javascript. A mechanism you could use is the onclose (I think it's called like that) callback of nodal, see fomantic ui for thar
That
As the modal and the form 'below' are on the page, you can js update the field value anytime you like
When clicking a button in the modal, when changing an input in the modal...
Or, as mentioned above, when closing the modal
Thomas Stokkeland
@stokkeland
yeah i'll use onClose or explicit OK button or similar.. i dont grasp how to identify the ID's of the fields above - perhaps formantic has it neatly somehow - so much to learn
Thomas Stokkeland
@stokkeland
will tackle that another day.. now for many to many relationships.. is there a a god model guide? i assume it is not enough to set models to point one/many many/one with the mapping table? I found this old page https://forum.agiletoolkit.org/t/creating-a-nice-ui-for-managing-many-to-many-relations/359 is that still the right type of direction?
Francesco Danti
@abbadon1334
is a correct guide, i think Philipp is still use it, but in the issue or PR there is another bunch of discussion about m-to-m
i think there are too many cases to cover it with a good documentation
for the rest you are running good, the problem of newcomers is the concept of partial reload and continuos web actions in callback that in standard web develop even if there is ajax calls is not soo standard to understand and use correctly
Thomas Stokkeland
@stokkeland
yeah.. i get the concept of ajax - but the hard part if getting how exactly it is implemented here, what is the proper way so to speak
Thomas Stokkeland
@stokkeland
grid is gerat btw - what i struggle with is how to hook things intot it - like a popup/modal "selector" or populating a different div with relevant data when selecting a record.. all that flow is trickiest to learn
Francesco Danti
@abbadon1334
the real good part is that you can leave the browser light out of many javascript computation because some or all are done server side and you use less to zero JS ( which is the best part)
Thomas Stokkeland
@stokkeland
all newbs should be told to read quickstart - do a couple of the tutorial items - then read core concepts from start to end - then do stuff for a few days, then read core concepts again... perhaps one more time after a few more days.. things make more sense second time around
Thomas Stokkeland
@stokkeland

so i am having an issue.. manipulating a model-tied form data with events.. consider

$button->on('click', function ($j) use($form) {
   $form->model['myfield'] = 'SomeValue';
   $form->model->save();  
   // This works, the model saves with set value - i dont want it save
   //  all i want is the form field  to get an updated value on screen, so that
   // form save can be chosen later..
   //
   // something like $form->js->setFormField('myfield','SomeValue') 
});

havent been able to grasp that without some manual js - which I am trying to avoid

PhilippGrashoff
@PhilippGrashoff
There is jsInput() method, check that
JsInput()->val()
PhilippGrashoff
@PhilippGrashoff
So what I mean, there is no need to have a server request here if you simply want to set that value to the input
Am on mobile, hard to type code
Something like on('click', $form->jsInput('inputname') - >val($otherform->jsInput('otherinputname') - >val())) ;
Thomas Stokkeland
@stokkeland
ah.. so that has potential.. does not look like FormField\CheckBox implements jsInput though, i tried a dirty and added it copied from Input, it "works" but val() just retruns "on" regardless of check state - guessing this is jquery function so tried is(':checked') but i couldnt get that to work.. trying to build js logic this way is probably not very proper.. going to re-thing how i implement this - what I really could need is an offline dataset that i work on and sav, before copying to actual model when user elects to save
Gowrav Vishwakarma
@gowrav-vishwakarma
Any one integrated Lumen with Atk before? It can handle API faster so...
WhatsApp Image 2019-09-15 at 6.35.25 PM.jpeg
in 3 Days 5k+ … Its getting really a Happy Hell
@romaninsh : What would you prefer to handle API in front with ATK ?
and oauth JWT Token for authentication
Thomas Stokkeland
@stokkeland
what is the the proper way of tying a dropdown with multi select to a model - if there is one? is it possible in the model definition with ui ? i couldn't figure that out, i assume the data type needs to be array serialize list or something but could not get any decoration to kick in
PhilippGrashoff
@PhilippGrashoff
@stokkeland if a dropdown allows multiple selection, it just submits the values comma seperated
so a normal text field should do the job
of course on data level thats not a too nice way of storing
PhilippGrashoff
@PhilippGrashoff
some native hasMany() UI would be great, which would be a mutiple select dropdown probably
Thomas Stokkeland
@stokkeland
yeah.. i keep going in circles about these things.. my issue is the stupid legacy schema i have to work with is not all that great a fit.. it is easy enough to create picking tools that work with the schema, but doing it all with multiple relations without saving them as a single transaction when done changing stuff is the hard part.. almost want to use temp tables/data holders, perhaps not a bad way when forced to work with existing schema
PhilippGrashoff
@PhilippGrashoff
legacy can really make life hard. My software is only 1 and a half year old and already I face my own legacy stuff :)
if you figure how you want you UI to be and maybe provide some sample screen, I'd be easier to help you
and yes, checkbox doensnt have jsInput() as its a Fomantic UI implementation. But then you can achieve it using jQuery:
$button->on('click', (new jQuery($checkbox))->checkbox('see FUI API'));
->checkbox('checked')
like this, no request is sent to the server, but only some JS happens on click
its quite nice that you can write simple JS stuff like this directly in PHP and ATK takes care of correct binding. The idea of having a unique ID for each HTML item is simply great.
Thomas Stokkeland
@stokkeland
yeah the js binding is very nice - it was getting complicated was all - had to add add some logic on the javascript side- so i have decided to use temporary tables instead, same mode on a different table, now i can manipulate and save from any modal or similar, when the user finally clicks his perceived save, it updates the prod-table with the data.. a nice side effect is that it gives you a level of session persistence for use, if the user managed to click away or something i can recover the "dirty data" form
Francesco Danti
@abbadon1334
@gowrav-vishwakarma I'm at home, now but if you want tomorrow between 14 and 16 London time I can make some time for you and speak together help solving bottlenecks. I'm curious on very high load how can we scale in app without any scaling
*hardware scaling