Sunday 15 September 2013

database - Web2py Rating Widget (5 of them and in the same line) -


I have a new problem

I have already done my widget, but now I have my database In 5 categories, there are 5 rating widgets.

My column has this column (named places.categ):

How can I add 5 rating widgets to those 21 markers according to the category? I could do this:

  db.define_table ('product', field ('a', 'integer', requirement = IS_IN_SET (category (1,6)), field ('B' ',' Integer 'is required, = IS_IN_SET (range (1,6)), field (' C ',' integer ', = IS_IN_SET (category (1,6)), field (' D ', Requires 'integer' = IS_IN_SET (range (1,6)), field ('E', 'integer', is required = IS_IN_SET (category (1,6)))   < P> This model is in my model / db.py and it is one of my controllers / default.py:  
  plugin_re Import from Ting_Visget Inject WidgetWidget # Widget db.product.A.widget = RatingWidget () Db.product.B.widget = RatingWidget () db.product.C.widget = RatingWidget () db.product.D.widget = RatingWidget () db.product.E.widget = RatingWidget () # form2 = SQLFORM .factory (# field ('rating', 'integer', widget = SQLFORM.widgets.RatingWidget)) # if form2.process () Approved: # print form2.vars.search form2 = SQLFORM (db.product) if form2. Accept (request.vers, session): session.flash = 'submitted% s'% form2.vars redirect (url) ('Index'))   

I have 5 rating widgets but they are my databases Are not connected to the power and vertical (5 lines) and not in one line, like I wanted.

TIA

PS: The plugin rating widget has been uploaded to me.

I resolved in another way. I get the color of each category with this code:

  var amarelo = new google.maps.MarkerImage ("http://labs.google.com/ridefinder/images/mm_20_yellow.png ", New google.maps.Size (12, 20), new google.maps.Point (0, 0), new google.maps.Point (6, 20)); Var vermelho = New google.maps.MarkerImage ("http://labs.google.com/ridefinder/images/mm_20_red.png", new google.maps.Size (12, 20), new google.maps.Point (0 , 0), new google.maps.Point (6, 20)); Var verde = new google.maps.MarkerImage ("http://labs.google.com/ridefinder/images/mm_20_green.png", new google.maps.size (12, 20), new google.maps.Point (0 , 0), new google.maps.Point (6, 20)); Var azul = new google.maps.MarkerImage ("http://labs.google.com/ridefinder/images/mm_20_blue.png", new google.maps.size (12, 20), new google.maps.Point (0 , 0), new google.maps.Point (6, 20)); Var branco = new google.maps.MarkerImage ("http://labs.google.com/ridefinder/images/mm_20_white.png", new google.maps.size (12, 20), new google.maps.Point (0 , 0), new google.maps.Point (6, 20)); Var sombra = new google.maps.MarkerImage ("http://labs.google.com/ridefinder/images/mm_20_shadow.png", new google.maps.size (22, 20), new google.maps.Point (0 , 0), new google.maps.Point (6, 20));   

I have awarded each category one (example) of this color:

  if (placescoordjs [i] [4] == ' A ') {marker = new google.maps.marker ({status: new google.maps.LatLng (locationcordes [i] [1], terrestrial courage [i] [2]), icon: amarelo, shadow: Monday, map: Title, Title: PlacesCorrection [I] [3]}); Google.maps.event.addListener (Marker, 'click', (function (marker, i) {return function () {infowindow.setContent (placecoordjs [i] [0]); infowindow.open (map, marker);} }) (Marker, i)); }   

I have more 3 "and if" and the last and final colors are with my final range.

Thanks anyway. ;)

No comments:

Post a Comment