Hybrid View

  1. #1
    Sencha User
    Join Date
    Jan 2011
    Location
    Lincoln RI
    Posts
    97
    Vote Rating
    0
    webarnie is on a distinguished road

      0  

    Default adding a checkbox to a ListView column

    adding a checkbox to a ListView column


    I have a listView with several columns. Two of the columns are true false, so I would like to display check boxes. In Ext designer, I have right licked on the column and chosen transform ListView Boolean column. The data is either “Y” or “N” and displays as either true or false. How can I get this to render as a checkbox? I also do not want the user to be able to change the data.

  2. #2
    Sencha - Desktop Packager Dev Team jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747
    Vote Rating
    7
    jarrednicholls will become famous soon enough jarrednicholls will become famous soon enough

      0  

    Default


    You could paste a template string into the "tpl" configuration for your column. That would be the easiest way most likely.

  3. #3
    Sencha User
    Join Date
    Jan 2011
    Location
    Lincoln RI
    Posts
    97
    Vote Rating
    0
    webarnie is on a distinguished road

      0  

    Default


    I tried using tpl and the checkbox displayed in the column and all were unchecked. The data has some checked and others unchecked. Also I was able to check and uncheck the checkbox. To implement the checkbox in a column, I suspect you need to right click on the column and transform it to a ListView BooleanColumn?

    Then add the tpl?
    Could you tell me or give me an example of what the tpl should be?
    Do i need to add a listener? not sure how to do this with ext designer. Could you tell me how?

    Thank you.

  4. #4
    Sencha - Desktop Packager Dev Team jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747
    Vote Rating
    7
    jarrednicholls will become famous soon enough jarrednicholls will become famous soon enough

      0  

    Default


    In the template, you can do conditional logic based on the boolean value. Let's say the field name is "active", you can do a conditional template like this:

    Code:
    <input type="checkbox" disabled="disabled" <tpl if="active">checked="checked"</tpl> />
    At least that's the gist of it. Does that makes sense? You can read more on XTemplates here, just expand the constructor line to see the details and examples.

  5. #5
    Sencha User
    Join Date
    Jan 2011
    Location
    Lincoln RI
    Posts
    97
    Vote Rating
    0
    webarnie is on a distinguished road

      0  

    Default


    Yes what you are saying make sense. The data in the field is either “Y” or “N”, so I guess this is not a Boolean field as I previously stated. I am using a ListView column adding the tpl for the checkbox. I change the code a bit but I think I’ve got the syntax wrong. I have 3 rows and only the second should be checked. I am getting all rows checked. I have looked for examples but have not had much luck. Could you tell me what I am doing wrong. Also could you point me to any good references for this? Thank you.

    Code:
    <input type="checkbox" disabled="disabled" <tpl if="dividendPolicy === 'Y'">checked="checked"</tpl> />
    

  6. #6
    Sencha - Desktop Packager Dev Team jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747
    Vote Rating
    7
    jarrednicholls will become famous soon enough jarrednicholls will become famous soon enough

      0  

    Default


    That looks correct to me. Are you sure dividendPolicy is not "Y" for all records? Is the field type in the store on "auto" or on "boolean"? If it's on boolean, try setting it to auto.

Similar Threads

  1. Adding Checkbox Column to a grid
    By mannyk in forum Ext Designer: Help & Discussion
    Replies: 2
    Last Post: 23 Aug 2010, 10:00 PM
  2. Checkbox Plus ListView
    By erizvi in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 9 Aug 2010, 5:10 PM
  3. adding checkbox dynamically to a checkbox group
    By muncher in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 19 Jul 2010, 12:46 PM
  4. [SOLVED] Adding Checkbox column in GridPanel via Ext Designer
    By Nightwish in forum Ext Designer: Help & Discussion
    Replies: 8
    Last Post: 6 Jul 2010, 7:25 PM
  5. how can I add checkbox in ListView's each item?
    By zzsnake in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 6 Aug 2009, 6:19 AM

Thread Participants: 3

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi