Re: [openstack-dev] [horizon] Set CSS style for each cell in Datatable according to the value

2016-04-18 Thread 严超
Thank you ! That works for me !

*Best Regards!*


*Chao Yan--About me : http://about.me/chao_yan
*

*My twitter: @yanchao727 *
*My Weibo: http://weibo.com/herewearenow *
*--*

2016-04-14 18:01 GMT+08:00 严超 :

> Can you be more explicit ? How should we overwrite the Cell Class of
> Horizon ?
> Is there a best practice ? Or example at hand ?
> Seems that is not easy for me and, it's the only choice here for that
> case?
>
> Thank you very mush for your reply !
>
> *Best Regards!*
>
>
> *Chao Yan--About me : http://about.me/chao_yan
> *
>
> *My twitter: @yanchao727 *
> *My Weibo: http://weibo.com/herewearenow *
> *--*
>
> 2016-04-14 17:44 GMT+08:00 Itxaka Serrano Garcia :
>
>> If Im reading the correct correctly, you can provide on your Table class
>> in the Meta, a cell_class.
>>
>> So you could create your custom Cell class that inherits from the normal
>> Cell class (from horizon.tables.base import Cell), and based on the data,
>> change the css before rendering?
>>
>>
>>
>>
>> On 04/14/2016 10:44 AM, 严超 wrote:
>>
>>> Hi, Everyone:
>>>  Is there a possible way to set CSS style for*each cell* in
>>> *DataTable* according to the value of the cell ? For example, if the
>>> cell value is *'available' *then the css should display a *green icon*
>>> as well, else if the cell value is *'error'* the the css should display
>>> a *red icon*.
>>>  What I found is horizon.tables*.*Columnoption:
>>>
>>> classes<
>>> http://docs.openstack.org/developer/horizon/ref/tables.html#horizon.tables.Column.classes
>>> >
>>>
>>>  An iterable of CSS classes which should be added to this
>>> column. Example: classes=('foo', 'bar').
>>>
>>>  But this sets all the column cell style.
>>>  Is there a possible way to set CSS style for* each cell
>>> respectively?*
>>>  I'm very grateful for answering.
>>>
>>> /*Best Regards!*/
>>> /*Chao Yan*
>>> **--
>>> About me : http://about.me/chao_yan/
>>> //My twitter: @yanchao727 
>>> /My Weibo: http://weibo.com/herewearenow
>>> --/*/
>>> /*
>>>
>>>
>>>
>>> __
>>> OpenStack Development Mailing List (not for usage questions)
>>> Unsubscribe:
>>> openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
>>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>>>
>>>
>> __
>> OpenStack Development Mailing List (not for usage questions)
>> Unsubscribe:
>> openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>>
>
>
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [horizon] Set CSS style for each cell in Datatable according to the value

2016-04-14 Thread 严超
Can you be more explicit ? How should we overwrite the Cell Class of
Horizon ?
Is there a best practice ? Or example at hand ?
Seems that is not easy for me and, it's the only choice here for that case?

Thank you very mush for your reply !

*Best Regards!*


*Chao Yan--About me : http://about.me/chao_yan
*

*My twitter: @yanchao727 *
*My Weibo: http://weibo.com/herewearenow *
*--*

2016-04-14 17:44 GMT+08:00 Itxaka Serrano Garcia :

> If Im reading the correct correctly, you can provide on your Table class
> in the Meta, a cell_class.
>
> So you could create your custom Cell class that inherits from the normal
> Cell class (from horizon.tables.base import Cell), and based on the data,
> change the css before rendering?
>
>
>
>
> On 04/14/2016 10:44 AM, 严超 wrote:
>
>> Hi, Everyone:
>>  Is there a possible way to set CSS style for*each cell* in
>> *DataTable* according to the value of the cell ? For example, if the
>> cell value is *'available' *then the css should display a *green icon*
>> as well, else if the cell value is *'error'* the the css should display
>> a *red icon*.
>>  What I found is horizon.tables*.*Columnoption:
>>
>> classes<
>> http://docs.openstack.org/developer/horizon/ref/tables.html#horizon.tables.Column.classes
>> >
>>
>>  An iterable of CSS classes which should be added to this
>> column. Example: classes=('foo', 'bar').
>>
>>  But this sets all the column cell style.
>>  Is there a possible way to set CSS style for* each cell
>> respectively?*
>>  I'm very grateful for answering.
>>
>> /*Best Regards!*/
>> /*Chao Yan*
>> **--
>> About me : http://about.me/chao_yan/
>> //My twitter: @yanchao727 
>> /My Weibo: http://weibo.com/herewearenow
>> --/*/
>> /*
>>
>>
>> __
>> OpenStack Development Mailing List (not for usage questions)
>> Unsubscribe:
>> openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>>
>>
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [horizon] Set CSS style for each cell in Datatable according to the value

2016-04-14 Thread Itxaka Serrano Garcia
If Im reading the correct correctly, you can provide on your Table class 
in the Meta, a cell_class.


So you could create your custom Cell class that inherits from the normal 
Cell class (from horizon.tables.base import Cell), and based on the 
data, change the css before rendering?





On 04/14/2016 10:44 AM, 严超 wrote:

Hi, Everyone:
 Is there a possible way to set CSS style for*each cell* in
*DataTable* according to the value of the cell ? For example, if the
cell value is *'available' *then the css should display a *green icon*
as well, else if the cell value is *'error'* the the css should display
a *red icon*.
 What I found is horizon.tables*.*Columnoption:

classes

 An iterable of CSS classes which should be added to this
column. Example: classes=('foo', 'bar').

 But this sets all the column cell style.
 Is there a possible way to set CSS style for* each cell respectively?*
 I'm very grateful for answering.

/*Best Regards!*/
/*Chao Yan*
**--
About me : http://about.me/chao_yan/
//My twitter: @yanchao727 
/My Weibo: http://weibo.com/herewearenow
--/*/
/*


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [horizon] Set CSS style for each cell in Datatable according to the value

2016-04-14 Thread 严超
Hi, Everyone:Is there a possible way to set CSS style for* each cell*
in *DataTable* according to the value of the cell ? For example, if the
cell value is *'available' *then the css should display a *green icon* as
well, else if the cell value is *'error'* the the css should display a *red
icon*. What I found is horizon.tables*.*Column option:classes


An iterable of CSS classes which should be added to this column.
  Example: classes=('foo', 'bar').
But this sets all the column cell style.
Is there a possible way to set CSS style for* each cell respectively?*
I'm very grateful for answering.

*Best Regards!*


*Chao Yan--About me : http://about.me/chao_yan
*

*My twitter: @yanchao727 *
*My Weibo: http://weibo.com/herewearenow *
*--*
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev