Updated 023 Adding a custom time field (markdown)

Amigo 2019-06-27 11:55:56 +02:00
parent 1b7c7a52a3
commit a8e6583ff2

@ -26,13 +26,15 @@ When 'new' in Component Builder Fields is clicked, 'New Fields' will be opened,
So a field had been created that makes it possible to still do that. For example: If 'Events' is opened on the Registry Dashboard there is a function where dates may be set. [00:06:58](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m58s) In there a date can be selected and the time adjusted and then 'Done' should be clicked. [00:07:26](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m26s) With that selection the field is updated . If that is the kind of field that you're looking for, The implementation is quite different when this kind of field is used(See video). For example: If 'Fields' is opened and 'text' is selected in the 'Type' column and a hint is added. (You could pause the video and look at the field XML.) [00:08:08](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m08s) Since this field is used in a repeatable field, the JavaScript is quite different because you have been working with a repeatable field where you could add as many fields as you liked but wanted the date field to be active on everyone of those and you could not really target a repeatable field simply by adding some JavaScript in the area unless that field's ID was known. [00:08:41](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m41s) Instead of doing it in here(See video) Javascript is actually added which is needed to make this field work into the repeatable fields structure.
### JavaScript Repeatable Field Time-Date _Important_
### JavaScript Repeatable Field Time-Date
If Field(See video) is opened, select 'Event Dates', then one of those values (in the XML Field Definition) '1196', is the ID of that date field. (You can pause the video and follow what is done there).
[00:09:24](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m24s) In 'Scripts' some styles is included as well as some JavaScript. There is a loop which loops 50 times. Looking at the Repeatable Field, it may be seen that only 50 fields are allowed to be added in the loop which is targeted through the dynamic PHP. [00:09:52](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m52s) Each of that fields is targeted. At the moment there is a row added. Check whether that row exists, if it does simply use the 'jQuery DateTimepicker', which is actually brought to the page by the script. It has some options which is tweakable. [00:10:19](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m19s) That's how that kind of date selecting picker method is added in a Repeatable Field. [00:10:43](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m43s) <<<<<<<<<<<<<<<<<
[00:09:24](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m24s) In 'Scripts' some styles is included as well as some JavaScript. There is a loop which loops 50 times. Looking at the Repeatable Field, it may be seen that only 50 fields are allowed to be added in the loop which is targeted through the dynamic PHP. [00:09:52](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m52s) Each of that fields is targeted. At the moment there is a row added. Check whether that row exists, if it does simply use the 'jQuery DateTimepicker', which is actually brought to the page by the script. It has some options which is tweakable. [00:10:19](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m19s) That's how that kind of date selecting picker method is added in a Repeatable Field. [00:10:43](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m43s)
### Multiple Date Fields
Another thing I have multiple date fields. If you open that(Dates) again, you will see that here I have a start and an ending date. In cost adjustment I also have a target date. If you look at my script you'd see that I have a field type array. [00:11:14](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m14s) Which basically is used to target those different fields in their different pop-ups. If you only targeting one field, you wouldn't need this extra iterating method or variable which I'm using. Instead of having to retype it for every field, I just added a loop in the php, it's just less code. [00:11:44](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m44s)
If you open 'Dates' again, it may be seen that there is a start and an ending date. In Cost Adjustment there is also a target date. [00:11:14](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m14s)Looking at the script there is a 'field type' array which basically is used to target those different fields in their different pop-ups. If only one field is targeted, this extra iterating method or variable is needed. Instead of having to retype it for every field, there is just a loop added in the PHP, it is just less code. [00:11:44](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m44s)<<<<<<<<<<<<<<<<<<<<
About further documentation I realized that that might be necessary. Honestly I just don't have time at the moment, because their component isn't earning me a great deal of income. Besides the fact that I myself I'm using it and developing components and I have developed quite a lot already. [00:12:14](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m14s) I realize that might be a community project. And something I would actually would encourage. Everywhere in component builder, in any of it's list views, we have an help menu. Which actually opens up a website [00:12:39](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m39s) which has a wiki option. It's actually a readmine website. Here is the URL, you could see it, if anyone wants to get involved in in the community, we help improve the documentation per list view as well as per function as you can see I've already done quite a bit in writing documentation for every list view, explaining these buttons. [00:13:11](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m11s) This help button here. You could add your own help by going to the help documentation. Here is the list of the already set up help. If you open one of these, you would see that here is the URL that we're using. As we develop this component further we would eventually add more help documentation right in the component, but it will map to this [00:13:46](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m46s) website, because that way or everybody can benefit from any improvements. So the website URL for those of you might want to go there. It's projects.vdm.io/ projects/Joomla-component-builder/wiki, and you could [00:14:10](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m10s) go there and from there navigate. If you want to get involved in editing the tutorial or the documentation, and you say to me, I would help you setup documentation, give me a greater discount on accessing the tutorials. We could strike a deal. Because to me I have a time constrained. [00:14:40](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m40s) At this point as a community project I hope you understand. Thanks so much.
Further documentation might be necessary but time does not allow it but it would be encouraged if it can be done as a community project .[00:12:14](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m14s) Everywhere in Component Builder, in any of it's list views, is a Help Menu which actually opens up a website which has a Wiki option. [00:12:39](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m39s) It's actually a Redmine website. Here is the URL, you could see it, if anyone wants to get involved in in the community, we help improve the documentation per list view as well as per function as you can see I've already done quite a bit in writing documentation for every list view, explaining these buttons. [00:13:11](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m11s) This help button here. You could add your own help by going to the help documentation. Here is the list of the already set up help. If you open one of these, you would see that here is the URL that we're using. As we develop this component further we would eventually add more help documentation right in the component, but it will map to this [00:13:46](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m46s) website, because that way or everybody can benefit from any improvements. So the website URL for those of you might want to go there. It's projects.vdm.io/ projects/Joomla-component-builder/wiki, and you could [00:14:10](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m10s) go there and from there navigate. If you want to get involved in editing the tutorial or the documentation, and you say to me, I would help you setup documentation, give me a greater discount on accessing the tutorials. We could strike a deal. Because to me I have a time constrained. [00:14:40](https://www.youtube.com/watch?v=epA9zv4yWu0&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m40s) At this point as a community project I hope you understand. Thanks so much.