Welcome, Guest. Please login or register.
Did you miss your activation email?
02/08/12, 08:42
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  General
| |-+  V2 Components (Flash MX 2004 - Flash 8) (Moderators: vesa kortelainen, Ronald Wernecke, Jorge Solis, ..:: Mazhar Hasan ::.., papachan)
| | |-+  big issue with multiple check boxes inside datagrid cell
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: big issue with multiple check boxes inside datagrid cell  (Read 7130 times)
Pluda
Senior Programmer
****
Posts: 270


View Profile
« on: 04/27/07, 11:42 »

Hello, I'm in a big trouble here, really need some assistence,

I'm building a food store, where people can order they meal.
the problem is I use my own cellrenderers to make one item have diferent choices.

So far so godd, but nkow I don't know how to make the event handlers to define witch of them are selected


My simple renderer is like this:

import mx.core.UIComponent;
class quantosRender extends UIComponent {
   //
   var img:MovieClip;
   var owner;
   var listOwner;
   var getDataLabel:Function;
   //
   function setValue(str:String, item:Object, sel:Boolean):Void {
      if (item[getDataLabel()] == undefined) {
         img._visible = false;
      } else {
         img.attachMovie("quantos", "_quantos_", _root.getNextHighestDepth());
      }
   }
}

what this does is to attach to my cell one movieClip I've on library whitch has 3 input areas inside

What I need is to know if people choose to write some value in them, or in witch of them.

I'm I being clear? My english is kind of stange

Thanks for help

Pluda
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« Reply #1 on: 04/27/07, 14:57 »

Add the code inside the MC you're attaching.

Jorge
Logged

Pluda
Senior Programmer
****
Posts: 270


View Profile
« Reply #2 on: 04/28/07, 04:01 »

Hello Jorge, thanks for reply,

What code should I put inside my attached movieClip?

I know how to do this in javascript, we make a loop to define the selected item, but in AS I'm not managing this to work, can you please be more specific?

Thank's a ton,

Pluda
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« Reply #3 on: 04/30/07, 01:21 »

Try using

mydatagrid.getItemAt(nrRow).nameOfColum.nameofTextfield.text

Jorge
Logged

Pluda
Senior Programmer
****
Posts: 270


View Profile
« Reply #4 on: 04/30/07, 12:59 »

hello, sorry i can't make it work.

I've made a different aproach, and is working good, I just need one litle help with the handler.

I need to know if my checkbox are or not selected when I press one button, so I use:

Code:
btn_mais._mais_.botao.onRelease = function() {
if ((janela_doses._doses_.quarto.selected=false) && (janela_doses._doses_.meia.selected=false) && (janela_doses._doses_.dose.selected=false)) {
var erro:String = "Deve escolher o tipo de dose pretendida";
getURL("javascript:alert('Width = "+erro+"')");
}
//
if ((janela_quants._quantos_.q_quarto.text == "") && (janela_quants._quantos_.q_meia.text == "") && (janela_quants._quantos_.q_dose.text == "")) {
var erro:String = "Deve indicar a quantidade pretendida";
getURL("javascript:alert('"+erro+"')");
}
};



This works pretty fine to check if the text areas are or not empty, but doesn't do nothing with the checkboxes, what I'm doing wrong here?

Many thanks, hope I can read you soon

Pluda
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6162


View Profile WWW Email
« Reply #5 on: 04/30/07, 13:44 »

dont intermix assignment and comparing operators Wink

something=true // assign true to something
something==true // delivers true, when is true and false, if not

btw - you can use the Alert component of flash Wink

If you want to use radiobuttons, which can be alternativly selected, you can group it into a radiogroup and ask the value of the group to fetch the selected button.
Logged

happy flashing
Cool
Ronald
Pluda
Senior Programmer
****
Posts: 270


View Profile
« Reply #6 on: 05/01/07, 05:45 »

Hello Ronald, thanks for reply,

Yep, you were right, using radio buttons this is easyer and it's now working as expected.
thanks for help,

Pluda
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
anything