How to give background color on item selection through click event

Posted by: fullah on 27 October 2017, 1:24 pm EST

  • Posted 27 October 2017, 1:24 pm EST

    Hi,

    This is http://jsfiddle.net/farhatullah/g9338o0f/51/ fiddle link. When i click on any item of wijmo list box, orange color will be applied as background color of selected item. When i click on first item, background color was not applied on click event.How to apply background color same as on all other item selection.

    Thanks
  • Replied 30 October 2017, 1:36 pm EST

    Hi Manish,

    first item of wijmo list box is selected when page load. how can we disable this bydefault function. I have searched on internet and find some solution but failed. Here is my wijmo list box code
    <wj-list-box style="height: 230px; width:332px; margin-left: -17px; padding:10px; cursor:pointer"
    is-content-html=true
    control="companyGrp"
    item-Formatter=CompanyGroupFormatter
    items-source="compGroups"
    display-member-path="Name"
    selected-value-path="GroupId"
    selected-value="selectedGroupId"
    selected-item=null
    selected-index-changed="CompanyGroup(s, e)">
    </wj-list-box>


    Can you tell me , no item did select at the time of wijmo list box after load.

    Thanks
  • Replied 15 November 2017, 6:06 am EST

    Hi,
    We are sorry for the late reply.
    The following code in item-formatter does not allow to apply orange color:
    if(index==0)
    {
    // alert(index)
    greenItemStyle = '<li style="background-color:#DBE5F0;" class="itemborderstyleCpy" ';
    }



    Once, you comment it, background color will be applied to first item too.

    For your second query, please refer to the following post:
    https://www.grapecity.com/en/forums/c1-archive/hoe-can-we-prevent-from-se#hi-you-can-set-currentitem

    Please post your query related to Wijmo 5 at the following forum:
    https://www.grapecity.com/en/forums/wijmo

    ~Manish
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels