HTML5 Data Bindings Formatter Support Product Page

Solved

trying to add a group by on a select drop list

Reported 27 Jan 2014 17:37:15
1
has this problem
27 Jan 2014 17:37:15 Jamie oates posted:
hey guys

some times I wish you would create some guides on some real things people do.... but anyway I am trying to add a group by to a select drop menu, here is my form:


<form class="form-inline">
	    <select name="search" id="city" placeholder="City Name" data-binding-repeat="{{search.groupBy( &quot;city&quot; )}}" data-binding-id="city" >
	      <option value="0"></option>
          <option value="{{repeat1.$name}}">{{repeat1.$name}}</option>
        </select>
	  <button type="submit" class="btn" onClick="dmxDataBindingsAction('refresh','hotels',{})">Search</button>
    </form>


and its now not providing any data or even drop menu....
help thx

Replies

Replied 27 Jan 2014 18:13:22
27 Jan 2014 18:13:22 Teodor Kuduschiev replied:
Hello,
It seems to me you are not using the latest versions of the extension. There is a video explaining how to use the Group By filter and the code generated following the video should be:

<select name="search" id="city" data-binding-repeat-children="{{search.data.groupBy( &quot;city&quot; )}}" data-binding-id="city" >
  <option value="{{$name}}">{{$name}}</option>
</select>

Replied 27 Jan 2014 18:35:58
27 Jan 2014 18:35:58 Jamie oates replied:
Hi Teo,
have just checked and plugins are confirmed as the latest, even ran the updater to be sure and nope says they are the same version.
I have tried to follow the group by video but of course its not directed at select drop downs, but i tried anyway could be i missed something....
also just tried the above code and now I do have data displayed but the list of cities is empty.......
will try it again from scratch, hope to have better luck
Replied 27 Jan 2014 18:46:04
27 Jan 2014 18:46:04 Teodor Kuduschiev replied:
Well there are a few steps you need to follow:
1. Click the Select field
2. Select [ data ] element in your data source
3. Select select.data.repeat-children and click Bind
4. Select the Formatter, add group by filter using the city element
5. Click refresh button in the data bindings panel so the repeat region appears
6. Click the select field again, under your repeat region select $name and bind to: select.data.option.value and select.data.option.title

Replied 27 Jan 2014 18:54:13
27 Jan 2014 18:54:13 Jamie oates replied:
after twentieth try its working now sorry was pulling my hair out already after so many tries!
Replied 27 Jan 2014 19:03:18
27 Jan 2014 19:03:18 Jamie oates replied:
while am at this how do I set an infinite number to be displayed? as wehn i group by am only being display some countries and not all.
have tried to remove the limit tag and also 0 with both not working only providing a few entries

Reply to this topic