Show all record of a list in a form

otto.arya

New Member
Hi, again from me..

so, a bit background info, im making an app for warehouse daily expected revenue, so the management have a way to compare expected revenue vs billing at the end of the month.

so the first element is a dropdownjoin from a project master table. This one acts like a header in a form.
project_id -- project_name

left join to:
---this group is repeating--
service_id -- service name -- price(autofill) -- qty

this is actually the same thing like my previous ticket, but the management want to change a bit how the user input the data.

now the issue here, to save user time when entering data, can we list all services of a project without adding service one at a time like in repeating group? because one project can have dozens of services that needs to be entry everytime a transaction occurs. And using repeating group adding one service at a time is time consuming and you know how hectic a warehouse can be especially in monday morning. (they also doesnt like the "processing time" of the cascading drop down)

but i still need the user to input quantity beside the prepopulated service list. i can calculate total price automatically using js.

tried using autofill to no avail, made a mockup using excel so you guys know what i mean.

index.php

now the list of service should prepopulate when user chose project on top instead of repeating group where they have to add one at a time,

thanks !
 

Attachments

  • mockup.png
    mockup.png
    15.7 KB · Views: 942
well thats fast..

"extensive" is a scary word.. so can i use any custom home made fresh from the oven php file for the php form plugin ? not using controller / model / viewer, just one php file from scratch for this form alone..

( i dont know how am i going to achieve that, but just to make sure i can in the first place) ..
 
Oh, not that extensive. It'd have to be done in Javascript. There's no way to default multiple repeat groups to different values on the server side. You can set the min and max repeats in the group settings, to get the number you want, but youd have to populate them in JS.

-- hugh
 
hi, just a quick update.. we finally able to do this using a AJAX calling a PHP file in the server. So we create a custom PHP file to load the data called by an AJAX in a drop down element so it would automatically load the data after chosing a dropdown, the data then displayed into a display element in the form, we just found out how useful that display element is. Then another custom PHP file to save the data also called by AJAX, in a button element.

so now the problem is we have two buttons, the first one is our custom button element to save, then the save button from fabrik. It is still there, is there anyway i can alter the script behind that save button ? as in using our AJAX script or anyway to hide the save button ?

thanks !
 
You could also use the fabrik.form.submit.start event, and run your AJAX call from that. I'm on my phone atm, so can't write code, but if you search the forums for requirejs, you'll find examples of setting up Fabrik.addEvent().

Hugh


Sent from my HTC One using Tapatalk
 
Damn should've looked into that option before googling things.. didnt know it was THAT easy..
thanks though !

@hugh
thanks, i think ill just hide that button..
 
OK, wasn't sure if you needed to also submit the form normally as well as post your data through AJAX. That event lets you do your own stuff when the Submit button is pressed, and optionally abort the actual form submit by returning false, or let the submit happened by returning true (well, by not returning false, really).

-- hugh
 
yea we already did that using a button element, we put the AJAX there to post the data as well as going back to the list view. No need for another submit button, so the easy way out is to just hide the default submit button.

Thanks !
--
 

Attachments

  • 07-Jan-16 3-19-54 PM.png
    07-Jan-16 3-19-54 PM.png
    26.6 KB · Views: 211
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top