⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Put three web dropdownlists from a callback



clausanoid
  • profile picture
  • Member

Posted 16 May 2013 - 22:03 PM

Hi everybody.. how i can put three webform dropdownlists so i can concatenate the values and put them in a database field? i have  an ubication field and i want  to set three drodowns so 

i can select if it is a shelf or a box then select the shelves/boxes letter  and then select a number  inserting them into 1 database field called ubication..

 

this is it 

http://www.youtube.com/watch?v=4sBOIIMc2Pw


 

Thanks in advice.. :3

 

P.D. excuse me for the poor english skills i am not an english native speaker  and for the craziness of the mouse movement


davidoster
  • profile picture
  • Member

Posted 16 May 2013 - 22:32 PM

So in essence, you have three dropdownlists where at least the first two are dependent to each other, for example

when the user selects on the first one 'box' then the second one must show boxes letter.

So for this case you need one of the two libraries that has been created from the programmers here,

1. /topic/1087-updated-24112012-dependent-dropdown-library/

2. /topic/1561-simple-dependant-dropdown-extension/

Then you need to use the callback_before_insert/update to make special manipulation of the data in order to concatenate the values.


clausanoid
  • profile picture
  • Member

Posted 16 May 2013 - 22:38 PM

thanks for the answer tha values of the dropdowns are not related there are simply values for a user input... they do not exist in the table or in the database they are only for inserting a box A 2 value in the ubication field  


davidoster
  • profile picture
  • Member

Posted 16 May 2013 - 22:44 PM

Then make the fields using the fields function and then use the callback_before_insert/update


clausanoid
  • profile picture
  • Member

Posted 16 May 2013 - 22:47 PM

we are using No-CMS so we are figuring out thaht functions again thanks for the answer


davidoster
  • profile picture
  • Member

Posted 16 May 2013 - 22:51 PM

Oh! I wouldn't know. You need to check with [member=gofrendiasgard] for this.


clausanoid
  • profile picture
  • Member

Posted 16 May 2013 - 22:52 PM

all right thank you for helping us


clausanoid
  • profile picture
  • Member

Posted 16 May 2013 - 23:18 PM

/

/ set model
        $crud->set_model($this->cms_module_path().'/grocerycrud_productos_compuestos_model');


        // adjust groceryCRUD's language to No-CMS's language
        $crud->set_language($this->cms_language());


        // table name
        $crud->set_table($this->cms_complete_table_name('productos_compuestos'));


        // set subject
        $crud->set_subject('Productos Compuestos');


        // displayed columns on list
        $crud->columns('num_ext','num_parte','descripcion','precio_compra','precio_venta','ubicacion_bodega','imagen','relprocom');----------------------------------------> this is where our "dummie" dropdown goes?
        // displayed columns on edit operation
        $crud->edit_fields('num_ext','num_parte','descripcion','precio_compra','precio_venta','ubicacion_bodega','imagen','relprocom');
        // displayed columns on add operation
        $crud->add_fields('num_ext','num_parte','descripcion','precio_compra','precio_venta','ubicacion_bodega','imagen','relprocom');


        // caption of each columns
        $crud->display_as('num_ext','Num Ext');
        $crud->display_as('num_parte','Num Parte');
        $crud->display_as('descripcion','Descripcion');
        $crud->display_as('precio_compra','Precio Compra');
        $crud->display_as('precio_venta','Precio Venta');
        $crud->display_as('ubicacion_bodega','Ubicacion Bodega');
        $crud->display_as('imagen','Imagen');
        $crud->display_as('relprocom','Relprocom');
$crud->callback_edit_field('ubicacion_bodega',array($this,'dropdownlist'));------------------------------------> our callbacks(they must be before?)?


$crud->callback_add_field('ubicacion_bodega',array($this,'dropdownlist'));




function dropdownlist()//$value, $primary_key ----------------------------> the action that is being called
{
    return '<select name="DONDE">
  <option value="Estante">Estante</option>
  <option value="Caja">Caja</option>
</select> 
<select name="COLUMNA">
 <option value="A">A</option>
  <option value="B">B</option>
    <option value="C">C</option>
      <option value="D">D</option>
        <option value="E">E</option>
          <option value="F">F</option>
           <option value="G">G</option>
  <option value="H">H</option>
    <option value="I">I</option>
      <option value="J">J</option>
        <option value="K">K</option>
          <option value="L">L</option>
           <option value="M">M</option>
  <option value="N">N</option>
    <option value="Ñ">Ñ</option>
      <option value="O">O</option>
        <option value="P">P</option>
          <option value="Q">Q</option>
           <option value="R">R</option>
  <option value="S">S</option>
    <option value="T">T</option>
      <option value="U">U</option>
        <option value="V">V</option>
          <option value="W">W</option>
           <option value="X">X</option>
  <option value="Y">Y</option>
    <option value="Z">Z</option>
</select> 
<select name="FILA">
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
  <option value="4">4</option>
  <option value="5">5</option>
  <option value="6">6</option>
  <option value="7">7</option>
  <option value="8">8</option>
  <option value="9">9</option>
  <option value="10">10</option>
  <option value="11">11</option>
  <option value="12">12</option>
  <option value="13">13</option>
  <option value="14">14</option>
  <option value="15">15</option>
  <option value="16">16</option>
  <option value="17">17</option>
  <option value="18">18</option>
  <option value="19">19</option>
  <option value="20">20</option>
  <option value="21">21</option>
  <option value="22">22</option>
  <option value="23">23</option>
  <option value="24">24</option>
  <option value="25">25</option>
  <option value="26">26</option>
  <option value="27">27</option>
  <option value="28">28</option>
  <option value="29">29</option>
  <option value="30">30</option>
  <option value="31">31</option>
  <option value="32">32</option>
  <option value="33">33</option>
  <option value="34">34</option>
  <option value="35">35</option>
  <option value="36">36</option>
  <option value="37">37</option>
  <option value="38">38</option>
  <option value="39">39</option>
  <option value="40">40</option>
  <option value="41">41</option>
  <option value="42">42</option>
  <option value="43">43</option>
  <option value="44">44</option>
  <option value="45">45</option>
  <option value="46">46</option>
  <option value="47">47</option>
  <option value="48">48</option>
  <option value="49">49</option>
  <option value="50">50</option>
</select> ';
}

this makes the dropdowns but they do not insert [member='davidoster']


goFrendiAsgard
  • profile picture
  • Member

Posted 17 May 2013 - 01:17 AM

Basically, what you can do with groceryCRUD and CodeIgniter can also be done with No-CMS.
No-CMS = CodeIgniter + groceryCRUD + some other components + my own code.

I'll make a new forum today, so that we can talk about No-CMS. I'll inform you later when I have finish set that up.


goFrendiAsgard
  • profile picture
  • Member

Posted 17 May 2013 - 02:15 AM

Okay guys, do you mind to move here http://www.getnocms.com/forum/