Updated 073 JCB Fields Type Extended (markdown)
parent
1e9cf80fc3
commit
7102c0e0df
@ -45,13 +45,15 @@ The name here is actually the code(See video) This is the type and this is what
|
||||
|
||||
[00:10:20](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m20s)
|
||||
|
||||
Then the 'button' feature is one of the features that are actually quite exciting. Let me show you some of that. So I was seeing a strange behavior here that the button says 'true' and then when I go to the code I don't see the button code in here. I was wondering what is going on here and then I remembered when JCB detects that [00:10:48](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m48s) there is two Custom Fields with the same type, it only uses one for this area and for the button because one of them is going to be the dominant one. [00:11:12](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m12s) You can decide which one it is so you want to share the field type among multiple Custom Fields so you want to reuse that field type, you can, but you want to make sure that one of them is the one which you know is going to be dominant, the one who decides how things happen. So that if you change that one the field type updates whereas if you change the wrong one it doesn't do anything. So just one of those will be the [00:11:47](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m47s) the dominant one so you could do that by making it the prime PHP and make that 'one'. Here is a little explanation of that. If you want to be sure this field called 'Preachers' should be the dominant and you want to say; I want the buttons to be 'true' and if you now, save and compile, you will get what you expect. That's **another feature of Custom Fields that people are not aware of** but it makes it very useful.
|
||||
Then the 'button' feature is one of the features that are quite exciting. Let me show you some of that. I was seeing a strange behavior here that the button says 'true' and then when I go to the code I don't see the button code in there. I was wondering what is going on here and then I remembered when JCB detects that [00:10:48](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m48s) there is two Custom Fields with the same type, it only uses one for this(the php for the getOption method) area and for the button. Because one of them is going to be the dominant one. [00:11:12](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m12s) You can decide which one it is, you want to share the field type among multiple Custom Fields. If you want to reuse that field type, you can. You want to make sure that one of them is the one which you know is going to be dominant, the one who decides how things happen. If you change that one the field type updates. Whereas if you change the wrong one it doesn't do anything. So just one of those will be the [00:11:47](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m47s) the dominant one. You can do that by making it the prime PHP and make that 'one'. Here is a little explanation of that. If you want to be sure this field called 'Preachers' should be the dominant and you want to say; I want the buttons to be 'true' if you save and compile, you will get what you expect. That's **another feature of Custom Fields that people are not aware of** but it makes it very useful.
|
||||
|
||||
### Get Input(How Button is added)
|
||||
|
||||
[00:12:29](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m29s)
|
||||
|
||||
So if we now go back to the code we see now a new set of a script here called `getinput` And that's really how the button gets added so basically asks `getAttribute('button')` it checks if `button` is `true`. If button is `true` then it already got the parent `HTML` (the whole field is in this HTML). If you have a button and someone clicks on it you might want them to [00:13:07](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m07s) be redirected back to this page where the field is once they are done on the other page. So this is what it does here it checks if there is a 'Referral'. We are building a return value as well so we come down here and we start to build the button. There is the the button being built(See Video) [00:13:44](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m44s) That is to create. This is called preachers right and down here we have a view called 'Preacher' and 'Preachers'. So that is the Single View, the Single View name of the place the field is added and this is the 'Listview' . We are grabbing the field data from the Preacher View and it's List name is 'Preachers' so it is the table where the data is being captured from. Not the table where you are going to show the field but the table where you are taking the information from.>>>>>>>>>>
|
||||
If we now go back to the code, we see a new set of a script called `getinput`. That's how the button gets added. It asks `getAttribute('button')`, it checks if `button` is `true`. If button is `true`, then it already have the parent `HTML` (the whole field is in this HTML). If you have a button and someone clicks on it, you might want them to [00:13:07](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m07s) be redirected back to this page where the field is, once they are done on the other page. This is what it does, it checks if there is a 'Referral'. We are building a return value as well. We come down here and we start to build the button. There is the button being built(See Video). [00:13:44](https://www.youtube.com/watch?v=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m44s) That is to create. This is called preachers, and down here we have a view called 'Preacher' and 'Preachers'. That is the Single View, the Single View name of the place, the field is added. This is the 'Listview'. We are grabbing the field data from the Preacher View, and it's List name is 'Preachers'. It is the table where the data is being captured from. Not the table where you are going to show the field but the table where you are taking the information from.
|
||||
|
||||
????
|
||||
|
||||
[00:14:55](https://www.youtube.com/watchv=91iIAuHZj38&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m55s)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user