For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 19 replies, 3 voices, and was last updated 13 years, 4 months ago by
nvts.
-
AuthorPosts
-
CygnusX3MemberPretty simple idea, but i’m super new to app development.
At my job we use some simple math that i am trying to make an app for.
Example of typical usage:
(40 (width of a pallet) * 48 (length of a pallet) * 12 (height of items on pallet)) / 1728
This gets us our cube of the pallet. I am trying to get a calculation app where you just check a radio button or box etc to select either large or small pallet (small pallets are 35 by 45) and manually enter the height.
Then something for manually inputting item weight * number of items to (plus weight of pallet, which is static at 120 lbs).
So i have a pictue in my head i just can’t figure out how to get it into an app.
April 5, 2013 at 10:12 am #337595
BrandonMemberMy suggestion is to do a layout in Mobione with what you could like it to look like, it may then be easier for someone to post some sample code.
April 5, 2013 at 5:54 pm #337641
CygnusX3MemberYou make a great point sir and i shall return with some screens
April 5, 2013 at 6:39 pm #337642
CygnusX3MemberOk, some visual aids (i kept it as simple as possible).
so what i am looking to do is basically run 2 calculations when you press the calculate button (dependent on the input values) and feed the results into the table.
so something along the lines of:
([Pallet Size] * [item height])/1728 (the checkbox would need to feed the appropriate size into the equation)
(Unit Weight * Unit Quantity)+120
Then have those 2 results fed into the Result cells.


I have decent experience with HTML4/CSS. Limited experience with HTML5 and next to no experience with Javascript. So i apologize for the simplicity of this request.
April 6, 2013 at 2:48 am #337649
CygnusX3MemberOr perhaps replace the check boxes with separate submit buttons, where each buttons submits the pallet values prior to calculating.
April 6, 2013 at 8:50 am #337654
nvtsMemberLooks pretty straight forward.
You will need to get the info from M1 for each field height,weight, quantity for each
height = document.getElementById(“m1-screenname-HeightTextField”).value;
Then write the js function in your app_custom.js file
Call the function from the buttons action calcpallet();
Then write it back to the 2 other text fields Item Cube & Total Weight
$(‘#m1-screenname-itemcube’).val ( );
Cheers…
April 6, 2013 at 9:11 am #337655
CygnusX3MemberThat info gives me a much better understanding of what i need to do. But in a very broad sense :P.
I think i have a final working design:

So, here’s the plan in a nutshell:
Text fields are filled in by user.
Clicking Large Pallet grabs item height and calculates (Item Height * 40 * 48) / 1728 and feeds the result to the table cell on the left.
It also grabs the Unit weight and Quantity and multiplies them together (Weight * Qty) + 120 and feeds the result to the table on the right.
Clicking Small Pallet does the same thing except (Item Height * 35 * 45) / 1728. Weight calculation stays the same.
Im a super newbie, so basically what i need is “This is the code to grab info from fields”. “This is the code for math calculations”. “This is the code for feeding into the table”. Obviously i know the ID of each field so filling that in is cake :P.
April 6, 2013 at 9:44 am #337656
nvtsMemberHave you written js code before or is that what you are needing to be done?
I am also a newbie. The best part is a lot of the samples that others have posted to see how the js code interacts with MobiOne designer.
If you need the code developed. zip what you have above and post it. Then I will be able to use your design and field names so you can see how this works.
Cheers…
April 7, 2013 at 4:06 am #337667
CygnusX3MemberWill get the file up ASAP. need to get it off the wife’s computer that i was using last night (japan time).
April 7, 2013 at 8:21 am #337668
CygnusX3Membernext question…do i need to google a file sharing site to host this zip so you can DL it?
April 7, 2013 at 9:07 am #337670
nvtsMemberNo,
Just attach it to the reply. Under the image verification.
April 7, 2013 at 11:00 am #337674
CygnusX3MemberSo i am horrible with WinRAR too i guess, it doesnt size the file down very much..only to 2MB wich is 1500 KB over the limit
April 7, 2013 at 11:24 am #337676
BrandonMemberTry something like this:
//Untested just to give you an idea for the code //for large myLarge = $('#m1-myform-itemHeightText').val() * 40 * 48; $('#m1-myform-itemTotalLeft').val(myLarge) ; //for small myLarge = $('#m1-myform-itemHeightText').val() * 35 * 45; $('#m1-myform-itemTotalLeft').val(myLarge); myWeight = $('#m1-myform-itemUnitWeight').val() *$('#m1-myform-itemUnitQuantity').val(); $('#m1-myform-itemTotalRight').val(myWeight ) ;April 7, 2013 at 11:39 am #337678
nvtsMemberSince you are having upload problems. It will be good practice for me with the calcs that I have waiting for this.
I will just put a quick app similar to your screens for you to see.
Cheers
April 7, 2013 at 11:43 am #337680
nvtsMemberCincy posted good example code. Except change the myLarge for the mySmall calcs :).
I will post my sample for you, if you would like.
Cheers…
-
AuthorPosts
