inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Feb 19, 2016 0:17:21 GMT -8
I'm looking to create a to do list plugin for use on Equestrian Heaven (there'll be multiple different checkbox'd lists).
I'm not sure if there's an easier way to do it or not but right now I've got an autoform that just creates a list of fields that will be getting assigned to one checkbox each. These will be checked to see if they are well checked as it were.
My first issue though is finding the length, as I'm after setting the checkboxes values etc by that method.
//Document Ready
$(document).ready(function(){
var toDoList = pb.plugin.get('to_do_list').settings;
//Problems to Fix p1 - create various tabs for the check lists as needed dynamically
var tab1lngthinfo = toDoList.unapp_chkbox.checkbox_label;
tab1lngthinfo.length;
//P2 - Generate checkboxes to mark if a task has been done or not
//P3 - Check if all checkboxes have been ticked and store to key. Each tickbox needs to store that its been ticked
//P4 - API to send money to users (maybe give a trophy if possible? Need to talk to Peter
//P5 - Output all information (done...ish)
$("#ToDoTest").append("<div class='container'><div class='title-bar'><h2>To Do List(s)</h2></div><div class='content cap-bottom' id='toDoBox'></div>");
$("#toDoBox").append("This is some text to check the appending works still");
});
The 3rd line and last lines work, its the part directly under the Problems to fix P1 comment that aren't working
|
|
inherit
201984
0
Sept 11, 2023 1:23:07 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓
Using My Talents Elsewhere
3,314
November 2013
pastuleo23
|
Post by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ on Feb 19, 2016 2:56:48 GMT -8
I'm looking to create a to do list plugin for use on Equestrian Heaven (there'll be multiple different checkbox'd lists). I'm not sure if there's an easier way to do it or not but right now I've got an autoform that just creates a list of fields that will be getting assigned to one checkbox each. These will be checked to see if they are well checked as it were. My first issue though is finding the length, as I'm after setting the checkboxes values etc by that method. //Document Ready
$(document).ready(function(){
var toDoList = pb.plugin.get('to_do_list').settings;
//Problems to Fix p1 - create various tabs for the check lists as needed dynamically
var tab1lngthinfo = toDoList.unapp_chkbox.checkbox_label;
tab1lngthinfo.length;
//P2 - Generate checkboxes to mark if a task has been done or not
//P3 - Check if all checkboxes have been ticked and store to key. Each tickbox needs to store that its been ticked
//P4 - API to send money to users (maybe give a trophy if possible? Need to talk to Peter
//P5 - Output all information (done...ish)
$("#ToDoTest").append("<div class='container'><div class='title-bar'><h2>To Do List(s)</h2></div><div class='content cap-bottom' id='toDoBox'></div>");
$("#toDoBox").append("This is some text to check the appending works still");
});
The 3rd line and last lines work, its the part directly under the Problems to fix P1 comment that aren't working I assume unapp_checkbox is your autoform so it would be unapp_checkbox.length or unapp_checkbox[0].checkboxlabel Meaning the 0 should be a variable assigned in a for loop
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Feb 19, 2016 7:49:14 GMT -8
Okay if I wanted to use a function to create the html layout to be fed info by the for loop (or to feed the layout INTO the for loop) what order should I use for this.
Should it be
For loop Function
Function For Loop
or
For Loop ( Function )
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Feb 20, 2016 5:32:23 GMT -8
Now I'd may as well just make it into a request. How can I learn if someone else decides to just do the coding for me rather then answering the question asked.
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Feb 20, 2016 6:46:07 GMT -8
Okay if I wanted to use a function to create the html layout to be fed info by the for loop (or to feed the layout INTO the for loop) what order should I use for this. Should it be For loop Function Function For Loop or For Loop ( Function ) Since you need to dynamically create the HTML from the data in the object (auto form item), then you would concat in the loop. i.e var my_list = "<div>";
for(...){ my_list += "..."; }
my_list += "</div>";
// Now do something with the HTML (i.e append to the DOM) If you are wanting to use a function, then send the item to the function and return it back to be concatenated to the string. Edit: Just to note; I left the "function" way that you asked about, as that above should be enough to get you started. It's hard explaining without an example, so I make it as minimal as possible.
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Feb 20, 2016 6:51:01 GMT -8
Thank you Peter!
Just a question - how do you create the tabs you used in Monetary shop (and I have a few trophey specific questions to ask you XP)
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Feb 20, 2016 6:51:26 GMT -8
Now I'd may as well just make it into a request. How can I learn if someone else decides to just do the coding for me rather then answering the question asked. I'm confused. You asked this... P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓, responded with the answer to that. Was that too much info from him?
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Feb 20, 2016 6:53:55 GMT -8
|
|
inherit
201984
0
Sept 11, 2023 1:23:07 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓
Using My Talents Elsewhere
3,314
November 2013
pastuleo23
|
Post by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ on Feb 20, 2016 19:44:54 GMT -8
Now I'd may as well just make it into a request. How can I learn if someone else decides to just do the coding for me rather then answering the question asked. I'm confused. You asked this... P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ , responded with the answer to that. Was that too much info from him? No i deleted the post that he is referring to. I was overhelping.
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Apr 21, 2016 21:51:43 GMT -8
Right I'm back plugging away at this - //Document Ready $( document ).ready(function() { var toDoList = pb.plugin.get('to_do_list').settings; //Problems to Fix p1 - create various tabs for the check lists as needed dynamically var tab1lngthinfo = toDoList.unapp_chkbox; console.log(tab1lngthinfo.length); //P5 - Output all information (done...ish) $("#ToDoTest").append("<div class='container'><div class='title-bar'><h2>To Do List(s)</h2></div><div class='content cap-bottom' id='toDoBox'></div>"); $("#toDoBox").append("<div id='tabs'><ul><li><a href='#unapp'>Unapproved Members To Do List</a></li><li><a href='#daily'>Daily To Do List</a></li></ul></div><div id='unapp'></div><div id='daily'><div id='tab2chkbox'>Eventually the Daily Checkbox will come here</div></div>"); //P2 - Generate checkboxes to mark if a task has been done or not $("#toDoBox").append ("<input type='checkbox' id='cbox2' value='second_checkbox'> <label for='cbox2'>This is the second checkbox</label>"); for(a=0;a< pb.plugin.get('to_do_list').settings.unapp_chkbox;a++){ $('#unapp').append('<form><input type="checkbox" id="'+pb.plugin.get('to_do_list').settings.unapp_chkbox.checkbox_id+'"value="'+pb.plugin.get('to_do_list').settings.unapp_chkbox.checkbox_label+'" ><label for="'+pb.plugin.get('to_do_list').settings.unapp_chkbox.checkbox_id+'">"'+pb.plugin.get('to_do_list').settings.unapp_chkbox.checkbox_label+'"</label></form'); } //P3 - Check if all checkboxes have been ticked and store to key. Each tickbox needs to store that its been ticked //P4 - API to send money to users (maybe give a trophy if possible? Need to talk to Peter }); Unless my eyes are really going blind I'm getting no errors but nor am I able to see the checkboxes appear, so if someone can double check that I haven't goofed up my naming or something
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Apr 21, 2016 23:16:35 GMT -8
Apparently I'm in the mood for derp! And that's not over doing it! That's helpful xD
As I say I was going to ask a totally unrelated question until I looked through my code as I pasted it here and went: hurr durr!
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Apr 21, 2016 23:21:34 GMT -8
Next question - is it okay to have a key store information when a checkbox changes state from unchecked to checked (and is it possible that when checkbox = checked that the checkbox is 'disabled' from becoming unchecked')
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Apr 23, 2016 1:38:58 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ - when you have time can you answer my question regarding storing checkbox changes to a key and if possible break it down on how to 'set' the key and push information to it (if you could do it similar to how you broke down the pop up dialog because that really helped) - I need to know everything from how to make the key ready to take information to how to push information to it hopefully when a checkbox is clicked.
|
|
inherit
201984
0
Sept 11, 2023 1:23:07 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓
Using My Talents Elsewhere
3,314
November 2013
pastuleo23
|
Post by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ on Apr 23, 2016 2:42:45 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ - when you have time can you answer my question regarding storing checkbox changes to a key and if possible break it down on how to 'set' the key and push information to it (if you could do it similar to how you broke down the pop up dialog because that really helped) - I need to know everything from how to make the key ready to take information to how to push information to it hopefully when a checkbox is clicked. I just recently made a plugin that stores checkbox values. I set the key with on click. That runs a function that checks the jquery .is(':checked') for the checks box. So if(thing.is(checked)){value = 1}else{value=0} When I load the key I add disabled='disabled' to the HTML to disable the check box. That would all go in an on click function You set the key the same as the other time As far as data organization I'm not sure how you want to organize your data for what is checked
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Apr 23, 2016 3:16:58 GMT -8
I've never managed to set a key that's my problem Or load a key
|
|