Hi!
I have some problems with the function "Drop-down list". I made a table with 2 values. In the website view the dropdown list is empty. Please take a look at my picture. How to set the first value of the list as default.
regards
wolkenlos
Appgini 5.30 Dropdown List Empty
Appgini 5.30 Dropdown List Empty
- Attachments
-
- d3.jpg (178.42 KiB) Viewed 6634 times
-
- AppGini Super Hero
- Posts: 85
- Joined: 2014-06-14 03:08
- Location: India
- Contact:
Re: Appgini 5.30 Dropdown List Empty
Hi,
You can use magic hooks and select the default value you want.
Magic Hooks is a javascript file with name same as tablename-dv.js
You select default value, you can use the following code
Newer versions of AppGini (5.20 and above)
where e8 is the ID of the container of the drop down (for AppGini apps, the ID is fieldname-container, where fieldname is the name of the drop-down field), "CA" is the new value. So, the code should be:
You can use magic hooks and select the default value you want.
Magic Hooks is a javascript file with name same as tablename-dv.js
You select default value, you can use the following code
Newer versions of AppGini (5.20 and above)
Code: Select all
$("#e8").select2("val", "CA");
Code: Select all
jQuery("#fieldname-container").select2("val", "new-value");
Re: Appgini 5.30 Dropdown List Empty
Hi!
Thx for the answer.
I am sorry i am not a coder
where have I put this file: tablename-dv.js (path) - name of my tablename or exactly "tablename-dv.js"
my 2 values are: FEM;;DIN
what have I to code into the file to have a dropdown list with the default value "FEM" first"
I have more dropdownlists.... how to fix it?
also working with: tablename-dv.js
THX A LOT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
greets
wolkenlos
Thx for the answer.
I am sorry i am not a coder
where have I put this file: tablename-dv.js (path) - name of my tablename or exactly "tablename-dv.js"
my 2 values are: FEM;;DIN
what have I to code into the file to have a dropdown list with the default value "FEM" first"
I have more dropdownlists.... how to fix it?
also working with: tablename-dv.js
THX A LOT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
greets
wolkenlos
-
- AppGini Super Hero
- Posts: 85
- Joined: 2014-06-14 03:08
- Location: India
- Contact:
Re: Appgini 5.30 Dropdown List Empty
You are welcome
Please go through this
http://bigprof.com/appgini/help/advance ... agic-files
And coming to
You need to page and go to inspect element for the dropdown and you find id="XXXX-container"
so you will replace fieldname-continer with xxxx-container
and new-value with "FEM"
Please go through this
http://bigprof.com/appgini/help/advance ... agic-files
And coming to
Code: Select all
jQuery("#fieldname-container").select2("val", "new-value");
so you will replace fieldname-continer with xxxx-container
and new-value with "FEM"
Re: Appgini 5.30 Dropdown List Empty
hi udayvatturi!
a little bit more help please
for example I made a new database with 2 tables
1 textfield
1 dropdown
Tablename: table1
Name of the dropdown: field3
2 Values: Peter;;Mary
Name of the conatiner (HTML view):
<div class="panel-body" id="table1_dv_container">
now I made a file: table1-dv.js
I uploaded this file to: /hooks
but I am sorry it dont work.... no effect
greets
wolkenlos
a little bit more help please
for example I made a new database with 2 tables
1 textfield
1 dropdown
Tablename: table1
Name of the dropdown: field3
2 Values: Peter;;Mary
Name of the conatiner (HTML view):
<div class="panel-body" id="table1_dv_container">
Code: Select all
<div class="row">
<!-- form inputs -->
<div class="col-md-8 col-lg-10" id="table1_dv_form">
<fieldset class="form-horizontal">
<div class="form-group">
<label for="field2" class="control-label col-lg-3">Field 2</label>
<div class="col-lg-9">
<input tabindex="1" maxlength="40" type="text" class="form-control" name="field2" id="field2" value="" required>
</div>
</div>
<div class="form-group">
<label for="field3" class="control-label col-lg-3">field3</label>
<div class="col-lg-9">
<select tabindex="1" style="width: 100%;" name="field3" id="field3">
<option value=""> </option>
<option value="Peter" >Peter</option>
<option value="Mary" >Mary</option></select><script>jQuery(function(){ jQuery("#field3").select2({ minimumResultsForSearch: 15 }); })</script>
</div>
</div>
</fieldset>
</div>
Code: Select all
$("#table1_dv_container").select2("val", "Peter");
jQuery("#table1_dv_container").select2("val", "Peter");
but I am sorry it dont work.... no effect
greets
wolkenlos
Re: Appgini 5.30 Dropdown List Empty
Wolkenlos,
its much easier:
- fill the first value of the possible values into 'Default': FEM
and generate. That's all.
its much easier:
- fill the first value of the possible values into 'Default': FEM
and generate. That's all.
Bert
I am using Appgini 5.75
I am using Appgini 5.75
-
- AppGini Super Hero
- Posts: 85
- Joined: 2014-06-14 03:08
- Location: India
- Contact:
Re: Appgini 5.30 Dropdown List Empty
Yes, that a simple process, how did i missed it.
Re: Appgini 5.30 Dropdown List Empty
Hallo Bertv and Udayvatturi!
Thank you very very much!
I changed the default value and BINGO it worked
greets
wolkenlos
Thank you very very much!
I changed the default value and BINGO it worked
greets
wolkenlos