changing text colrs in combo boxes

View: New views
9 Messages — Rating Filter:   Alert me  

changing text colrs in combo boxes

by frederic_viollet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Cyril,

After adding an item in a Combo widget, I'd like to change this item's
color.
For example, I'd like to display n lines in "standard" black, and one
line in red.
Is there a way to do this?

Thanks

Fred


Re: changing text colrs in combo boxes

by Cyril Balit :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Fred,

I add some features in the combo component.

The addItem can take a third parameter which is an style object where
each propertie is a css rule

something like

myCombo= new rialto.widget.Combo(...);
myCombo.addItem("#FF3366","Red",{color:"red"});

You can also retrieve combo item with the getItem function that use an
index parameter. And on this item you have a setStyle method where the
parameter is also a style object
Example:

var it=myCombo.getItem(3);
  it.setStyle({color:"pink"});

Just update your rialto.js file.

Cyril


--- In rialto-dev@..., "frederic_viollet"
<frederic.viollet@...> wrote:

>
> Hi Cyril,
>
> After adding an item in a Combo widget, I'd like to change this item's
> color.
> For example, I'd like to display n lines in "standard" black, and one
> line in red.
> Is there a way to do this?
>
> Thanks
>
> Fred
>



Re: changing text colrs in combo boxes

by frederic_viollet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, great Cyril,

I'll try this out as soon as possible.

By the way, I was asking myself if it would be possible to change a
little bit the delivery process.
I mean here that if there could be nightly builds associated to
official releases all accessible through http, it would be much more
easy to download the latest version. Just as it is done for other
opensources.
At the moment, all sources are in an SVN repository and in my company,
we don't have access to such ports. I guess it is the same for most of
the companies.
Do you think such an evolution could be done on the Rialto web site?

Thanks again.

Fred

--- In rialto-dev@..., "Cyril Balit" <cbalit@...> wrote:

>
> Fred,
>
> I add some features in the combo component.
>
> The addItem can take a third parameter which is an style object where
> each propertie is a css rule
>
> something like
>
> myCombo= new rialto.widget.Combo(...);
> myCombo.addItem("#FF3366","Red",{color:"red"});
>
> You can also retrieve combo item with the getItem function that use an
> index parameter. And on this item you have a setStyle method where the
> parameter is also a style object
> Example:
>
> var it=myCombo.getItem(3);
>   it.setStyle({color:"pink"});
>
> Just update your rialto.js file.
>
> Cyril
>
>
> --- In rialto-dev@..., "frederic_viollet"
> <frederic.viollet@> wrote:
> >
> > Hi Cyril,
> >
> > After adding an item in a Combo widget, I'd like to change this item's
> > color.
> > For example, I'd like to display n lines in "standard" black, and one
> > line in red.
> > Is there a way to do this?
> >
> > Thanks
> >
> > Fred
> >
>



Re: changing text colrs in combo boxes

by frederic_viollet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Cyril,

I tried the new addItem function.
I added the following style object : {color:"red"}. In the drop list,
my item is correctly written in red. But if I select the item, it is
displayed in black. Could the item's style be also used to display the
item when selected?

Thanks.

Fred

--- In rialto-dev@..., "Cyril Balit" <cbalit@...> wrote:

>
> Fred,
>
> I add some features in the combo component.
>
> The addItem can take a third parameter which is an style object where
> each propertie is a css rule
>
> something like
>
> myCombo= new rialto.widget.Combo(...);
> myCombo.addItem("#FF3366","Red",{color:"red"});
>
> You can also retrieve combo item with the getItem function that use an
> index parameter. And on this item you have a setStyle method where the
> parameter is also a style object
> Example:
>
> var it=myCombo.getItem(3);
>   it.setStyle({color:"pink"});
>
> Just update your rialto.js file.
>
> Cyril
>
>
> --- In rialto-dev@..., "frederic_viollet"
> <frederic.viollet@> wrote:
> >
> > Hi Cyril,
> >
> > After adding an item in a Combo widget, I'd like to change this item's
> > color.
> > For example, I'd like to display n lines in "standard" black, and one
> > line in red.
> > Is there a way to do this?
> >
> > Thanks
> >
> > Fred
> >
>



Re: changing text colrs in combo boxes

by frederic_viollet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Cyril,

Any news about this one? ;)

Thanks.

Fred

--- In rialto-dev@..., "frederic_viollet"
<frederic.viollet@...> wrote:

>
> Hi Cyril,
>
> I tried the new addItem function.
> I added the following style object : {color:"red"}. In the drop list,
> my item is correctly written in red. But if I select the item, it is
> displayed in black. Could the item's style be also used to display the
> item when selected?
>
> Thanks.
>
> Fred
>
> --- In rialto-dev@..., "Cyril Balit" <cbalit@> wrote:
> >
> > Fred,
> >
> > I add some features in the combo component.
> >
> > The addItem can take a third parameter which is an style object where
> > each propertie is a css rule
> >
> > something like
> >
> > myCombo= new rialto.widget.Combo(...);
> > myCombo.addItem("#FF3366","Red",{color:"red"});
> >
> > You can also retrieve combo item with the getItem function that use an
> > index parameter. And on this item you have a setStyle method where the
> > parameter is also a style object
> > Example:
> >
> > var it=myCombo.getItem(3);
> >   it.setStyle({color:"pink"});
> >
> > Just update your rialto.js file.
> >
> > Cyril
> >
> >
> > --- In rialto-dev@..., "frederic_viollet"
> > <frederic.viollet@> wrote:
> > >
> > > Hi Cyril,
> > >
> > > After adding an item in a Combo widget, I'd like to change this
item's
> > > color.
> > > For example, I'd like to display n lines in "standard" black,
and one
> > > line in red.
> > > Is there a way to do this?
> > >
> > > Thanks
> > >
> > > Fred
> > >
> >
>



Re: changing text colrs in combo boxes

by Cyril Balit :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Fred,

I first chose voluntarily not to apply the item style to the text but
i change my mind.

As i can perform update for now (i 'm working on the V1) if you are
hurry you can replace the rialto.widget.Combo.prototype.selInd
function of the combo by the following.

rialto.widget.Combo.prototype.selInd=function (ind,execAppliCode){    
        if(ind>=0 && ind<this.currentListItem.length){
                //close the list
            if(this.opslist.open){this.setOpen(false);}
            var item=this.currentListItem[ind];
            //text and value
            var text=item.text;
            var value=item.value;
                //this.selItem(val,text);
                //fill the input text
            this.text.setValue(text);
            //if style with the item apply to the text
            if(item.style){
            this.setStyle(item.style);
            }    
            this.wvalue=text;
            //fill the input valut
            this.textValue.setValue(value);    
                if(this.isRequired){
                        this.text.removeAsRequired();
                }
    }
    //call the onclick method
    if(execAppliCode){this.onclick(value,text)};
}


Cyril

--- In rialto-dev@..., "frederic_viollet"
<frederic.viollet@...> wrote:

>
> Hi Cyril,
>
> Any news about this one? ;)
>
> Thanks.
>
> Fred
>
> --- In rialto-dev@..., "frederic_viollet"
> <frederic.viollet@> wrote:
> >
> > Hi Cyril,
> >
> > I tried the new addItem function.
> > I added the following style object : {color:"red"}. In the drop list,
> > my item is correctly written in red. But if I select the item, it is
> > displayed in black. Could the item's style be also used to display the
> > item when selected?
> >
> > Thanks.
> >
> > Fred
> >
> > --- In rialto-dev@..., "Cyril Balit" <cbalit@> wrote:
> > >
> > > Fred,
> > >
> > > I add some features in the combo component.
> > >
> > > The addItem can take a third parameter which is an style object
where
> > > each propertie is a css rule
> > >
> > > something like
> > >
> > > myCombo= new rialto.widget.Combo(...);
> > > myCombo.addItem("#FF3366","Red",{color:"red"});
> > >
> > > You can also retrieve combo item with the getItem function that
use an
> > > index parameter. And on this item you have a setStyle method
where the

> > > parameter is also a style object
> > > Example:
> > >
> > > var it=myCombo.getItem(3);
> > >   it.setStyle({color:"pink"});
> > >
> > > Just update your rialto.js file.
> > >
> > > Cyril
> > >
> > >
> > > --- In rialto-dev@..., "frederic_viollet"
> > > <frederic.viollet@> wrote:
> > > >
> > > > Hi Cyril,
> > > >
> > > > After adding an item in a Combo widget, I'd like to change this
> item's
> > > > color.
> > > > For example, I'd like to display n lines in "standard" black,
> and one
> > > > line in red.
> > > > Is there a way to do this?
> > > >
> > > > Thanks
> > > >
> > > > Fred
> > > >
> > >
> >
>



Re: changing text colrs in combo boxes

by frederic_viollet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Cyril,
I've just tested the "color in combo" feature.
I populated my combobox in the following way:

myCombo.addItm("type1","type1")
myCombo.addItem("type2","type2");
myCombo.addItem("type3","type3",{color:"red"});
myCombo.selWithValue("type3");

The "type3" item is displayed in red and the two others are dislayed
in black (this is correct)
If I select "type1", "type1" is displayed in red instead of black.
It seems that, once I have selected "type3", I can't get the display
back to black.

Any ideas?

Thanks.

Fred

--- In rialto-dev@..., "Cyril Balit" <cbalit@...> wrote:

>
>
> Fred,
>
> I first chose voluntarily not to apply the item style to the text but
> i change my mind.
>
> As i can perform update for now (i 'm working on the V1) if you are
> hurry you can replace the rialto.widget.Combo.prototype.selInd
> function of the combo by the following.
>
> rialto.widget.Combo.prototype.selInd=function (ind,execAppliCode){    
> if(ind>=0 && ind<this.currentListItem.length){
> //close the list
>    if(this.opslist.open){this.setOpen(false);}
>    var item=this.currentListItem[ind];
>    //text and value
>    var text=item.text;
>    var value=item.value;
> //this.selItem(val,text);
> //fill the input text
>    this.text.setValue(text);
>    //if style with the item apply to the text
>    if(item.style){
>     this.setStyle(item.style);
>    }    
>    this.wvalue=text;
>    //fill the input valut
>    this.textValue.setValue(value);    
> if(this.isRequired){
> this.text.removeAsRequired();
> }
>     }
>     //call the onclick method
>     if(execAppliCode){this.onclick(value,text)};
> }
>
>
> Cyril
>
> --- In rialto-dev@..., "frederic_viollet"
> <frederic.viollet@> wrote:
> >
> > Hi Cyril,
> >
> > Any news about this one? ;)
> >
> > Thanks.
> >
> > Fred
> >
> > --- In rialto-dev@..., "frederic_viollet"
> > <frederic.viollet@> wrote:
> > >
> > > Hi Cyril,
> > >
> > > I tried the new addItem function.
> > > I added the following style object : {color:"red"}. In the drop
list,
> > > my item is correctly written in red. But if I select the item, it is
> > > displayed in black. Could the item's style be also used to
display the

> > > item when selected?
> > >
> > > Thanks.
> > >
> > > Fred
> > >
> > > --- In rialto-dev@..., "Cyril Balit" <cbalit@> wrote:
> > > >
> > > > Fred,
> > > >
> > > > I add some features in the combo component.
> > > >
> > > > The addItem can take a third parameter which is an style object
> where
> > > > each propertie is a css rule
> > > >
> > > > something like
> > > >
> > > > myCombo= new rialto.widget.Combo(...);
> > > > myCombo.addItem("#FF3366","Red",{color:"red"});
> > > >
> > > > You can also retrieve combo item with the getItem function that
> use an
> > > > index parameter. And on this item you have a setStyle method
> where the
> > > > parameter is also a style object
> > > > Example:
> > > >
> > > > var it=myCombo.getItem(3);
> > > >   it.setStyle({color:"pink"});
> > > >
> > > > Just update your rialto.js file.
> > > >
> > > > Cyril
> > > >
> > > >
> > > > --- In rialto-dev@..., "frederic_viollet"
> > > > <frederic.viollet@> wrote:
> > > > >
> > > > > Hi Cyril,
> > > > >
> > > > > After adding an item in a Combo widget, I'd like to change this
> > item's
> > > > > color.
> > > > > For example, I'd like to display n lines in "standard" black,
> > and one
> > > > > line in red.
> > > > > Is there a way to do this?
> > > > >
> > > > > Thanks
> > > > >
> > > > > Fred
> > > > >
> > > >
> > >
> >
>



Re: changing text colrs in combo boxes

by Cyril Balit :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Fred,

I fixed it. Update your rialto.js file

Cyril


--- In rialto-dev@..., "frederic_viollet"
<frederic.viollet@...> wrote:

>
> Hi Cyril,
> I've just tested the "color in combo" feature.
> I populated my combobox in the following way:
>
> myCombo.addItm("type1","type1")
> myCombo.addItem("type2","type2");
> myCombo.addItem("type3","type3",{color:"red"});
> myCombo.selWithValue("type3");
>
> The "type3" item is displayed in red and the two others are dislayed
> in black (this is correct)
> If I select "type1", "type1" is displayed in red instead of black.
> It seems that, once I have selected "type3", I can't get the display
> back to black.
>
> Any ideas?
>
> Thanks.
>
> Fred
>
> --- In rialto-dev@..., "Cyril Balit" <cbalit@> wrote:
> >
> >
> > Fred,
> >
> > I first chose voluntarily not to apply the item style to the text but
> > i change my mind.
> >
> > As i can perform update for now (i 'm working on the V1) if you are
> > hurry you can replace the rialto.widget.Combo.prototype.selInd
> > function of the combo by the following.
> >
> > rialto.widget.Combo.prototype.selInd=function (ind,execAppliCode){    
> > if(ind>=0 && ind<this.currentListItem.length){
> > //close the list
> >    if(this.opslist.open){this.setOpen(false);}
> >    var item=this.currentListItem[ind];
> >    //text and value
> >    var text=item.text;
> >    var value=item.value;
> > //this.selItem(val,text);
> > //fill the input text
> >    this.text.setValue(text);
> >    //if style with the item apply to the text
> >    if(item.style){
> >     this.setStyle(item.style);
> >    }    
> >    this.wvalue=text;
> >    //fill the input valut
> >    this.textValue.setValue(value);    
> > if(this.isRequired){
> > this.text.removeAsRequired();
> > }
> >     }
> >     //call the onclick method
> >     if(execAppliCode){this.onclick(value,text)};
> > }
> >
> >
> > Cyril
> >
> > --- In rialto-dev@..., "frederic_viollet"
> > <frederic.viollet@> wrote:
> > >
> > > Hi Cyril,
> > >
> > > Any news about this one? ;)
> > >
> > > Thanks.
> > >
> > > Fred
> > >
> > > --- In rialto-dev@..., "frederic_viollet"
> > > <frederic.viollet@> wrote:
> > > >
> > > > Hi Cyril,
> > > >
> > > > I tried the new addItem function.
> > > > I added the following style object : {color:"red"}. In the drop
> list,
> > > > my item is correctly written in red. But if I select the item,
it is

> > > > displayed in black. Could the item's style be also used to
> display the
> > > > item when selected?
> > > >
> > > > Thanks.
> > > >
> > > > Fred
> > > >
> > > > --- In rialto-dev@..., "Cyril Balit" <cbalit@> wrote:
> > > > >
> > > > > Fred,
> > > > >
> > > > > I add some features in the combo component.
> > > > >
> > > > > The addItem can take a third parameter which is an style object
> > where
> > > > > each propertie is a css rule
> > > > >
> > > > > something like
> > > > >
> > > > > myCombo= new rialto.widget.Combo(...);
> > > > > myCombo.addItem("#FF3366","Red",{color:"red"});
> > > > >
> > > > > You can also retrieve combo item with the getItem function that
> > use an
> > > > > index parameter. And on this item you have a setStyle method
> > where the
> > > > > parameter is also a style object
> > > > > Example:
> > > > >
> > > > > var it=myCombo.getItem(3);
> > > > >   it.setStyle({color:"pink"});
> > > > >
> > > > > Just update your rialto.js file.
> > > > >
> > > > > Cyril
> > > > >
> > > > >
> > > > > --- In rialto-dev@..., "frederic_viollet"
> > > > > <frederic.viollet@> wrote:
> > > > > >
> > > > > > Hi Cyril,
> > > > > >
> > > > > > After adding an item in a Combo widget, I'd like to change
this

> > > item's
> > > > > > color.
> > > > > > For example, I'd like to display n lines in "standard" black,
> > > and one
> > > > > > line in red.
> > > > > > Is there a way to do this?
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > > Fred
> > > > > >
> > > > >
> > > >
> > >
> >
>



Re: changing text colrs in combo boxes

by frederic_viollet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Cyril, it works.

Fred

--- In rialto-dev@..., "Cyril Balit" <cbalit@...> wrote:

>
> Fred,
>
> I fixed it. Update your rialto.js file
>
> Cyril
>
>
> --- In rialto-dev@..., "frederic_viollet"
> <frederic.viollet@> wrote:
> >
> > Hi Cyril,
> > I've just tested the "color in combo" feature.
> > I populated my combobox in the following way:
> >
> > myCombo.addItm("type1","type1")
> > myCombo.addItem("type2","type2");
> > myCombo.addItem("type3","type3",{color:"red"});
> > myCombo.selWithValue("type3");
> >
> > The "type3" item is displayed in red and the two others are dislayed
> > in black (this is correct)
> > If I select "type1", "type1" is displayed in red instead of black.
> > It seems that, once I have selected "type3", I can't get the display
> > back to black.
> >
> > Any ideas?
> >
> > Thanks.
> >
> > Fred
> >
> > --- In rialto-dev@..., "Cyril Balit" <cbalit@> wrote:
> > >
> > >
> > > Fred,
> > >
> > > I first chose voluntarily not to apply the item style to the
text but
> > > i change my mind.
> > >
> > > As i can perform update for now (i 'm working on the V1) if you are
> > > hurry you can replace the rialto.widget.Combo.prototype.selInd
> > > function of the combo by the following.
> > >
> > > rialto.widget.Combo.prototype.selInd=function
(ind,execAppliCode){    

> > > if(ind>=0 && ind<this.currentListItem.length){
> > > //close the list
> > >    if(this.opslist.open){this.setOpen(false);}
> > >    var item=this.currentListItem[ind];
> > >    //text and value
> > >    var text=item.text;
> > >    var value=item.value;
> > > //this.selItem(val,text);
> > > //fill the input text
> > >    this.text.setValue(text);
> > >    //if style with the item apply to the text
> > >    if(item.style){
> > >     this.setStyle(item.style);
> > >    }    
> > >    this.wvalue=text;
> > >    //fill the input valut
> > >    this.textValue.setValue(value);    
> > > if(this.isRequired){
> > > this.text.removeAsRequired();
> > > }
> > >     }
> > >     //call the onclick method
> > >     if(execAppliCode){this.onclick(value,text)};
> > > }
> > >
> > >
> > > Cyril
> > >
> > > --- In rialto-dev@..., "frederic_viollet"
> > > <frederic.viollet@> wrote:
> > > >
> > > > Hi Cyril,
> > > >
> > > > Any news about this one? ;)
> > > >
> > > > Thanks.
> > > >
> > > > Fred
> > > >
> > > > --- In rialto-dev@..., "frederic_viollet"
> > > > <frederic.viollet@> wrote:
> > > > >
> > > > > Hi Cyril,
> > > > >
> > > > > I tried the new addItem function.
> > > > > I added the following style object : {color:"red"}. In the drop
> > list,
> > > > > my item is correctly written in red. But if I select the item,
> it is
> > > > > displayed in black. Could the item's style be also used to
> > display the
> > > > > item when selected?
> > > > >
> > > > > Thanks.
> > > > >
> > > > > Fred
> > > > >
> > > > > --- In rialto-dev@..., "Cyril Balit" <cbalit@>
wrote:
> > > > > >
> > > > > > Fred,
> > > > > >
> > > > > > I add some features in the combo component.
> > > > > >
> > > > > > The addItem can take a third parameter which is an style
object
> > > where
> > > > > > each propertie is a css rule
> > > > > >
> > > > > > something like
> > > > > >
> > > > > > myCombo= new rialto.widget.Combo(...);
> > > > > > myCombo.addItem("#FF3366","Red",{color:"red"});
> > > > > >
> > > > > > You can also retrieve combo item with the getItem function
that

> > > use an
> > > > > > index parameter. And on this item you have a setStyle method
> > > where the
> > > > > > parameter is also a style object
> > > > > > Example:
> > > > > >
> > > > > > var it=myCombo.getItem(3);
> > > > > >   it.setStyle({color:"pink"});
> > > > > >
> > > > > > Just update your rialto.js file.
> > > > > >
> > > > > > Cyril
> > > > > >
> > > > > >
> > > > > > --- In rialto-dev@..., "frederic_viollet"
> > > > > > <frederic.viollet@> wrote:
> > > > > > >
> > > > > > > Hi Cyril,
> > > > > > >
> > > > > > > After adding an item in a Combo widget, I'd like to change
> this
> > > > item's
> > > > > > > color.
> > > > > > > For example, I'd like to display n lines in "standard"
black,

> > > > and one
> > > > > > > line in red.
> > > > > > > Is there a way to do this?
> > > > > > >
> > > > > > > Thanks
> > > > > > >
> > > > > > > Fred
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>


LightInTheBox - Buy quality products at wholesale price