Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to get checkbox value when formatted

    1)I have following checkbox code to get an HTML check box in the list grid. This redenders the checkbox properly .But now how to retrieve this checkbox value i.e. true/false. here if i try to get the value then i get the html code of checkbox.




    Code:
    isc.ListGrid.create({
        ID: "countryList",
      
        fields:[
        		{name:"selection", type:"boolean",  value:false,
        		 
        		 formatCellValue: function (value, record, rowNum, colNum, grid)
        		 {
    					if(value)
    						return "<input type=\"checkbox\" checked/>";
    					else
    						return "<input type=\"checkbox\"/>";
    				 }
    
        		}
    
        ]

    2) Also if there is any other approach to render checkbox and retrieve its value is appreciated.
    Note: With the examples given in tutorial document,when the checkbox is not selected then the cell looks blank and user can not identify whether any checkbox exist in the cell.

    #2
    To me it seems like a tremendously bad idea to try to do what you're doing. But, if you want to make that work, I'd look at how SC outputs the html for the checkbox under normal conditions (for example, with firebug) and try to make your output as similar as possible. i.e. Set all names and classes etc on the input element so that the SC framework has a fighting chance at finding your "rogue" element.

    Comment


      #3
      RHegelson is right, don't attempt what you're up to, booleanTrueImage and booleanFalseImage allow configuration of what images are showing.

      Comment


        #4
        How to set path for booleanFalseImage

        ok. How to set path for booleanFalseImage?

        We have tried specifying the path as following two ways :

        Code:
        {name:"select",  type:"boolean", canEdit:true, canToggle:true, booleanFalseImage:Page.getSkinDir() + "/images/DynamicForm/unchecked_Down.gif"},
        Code:
        {name:"select",  type:"boolean", canEdit:true, canToggle:true, booleanFalseImage:"[SKIN]DynamicForm/unchecked_Down.gif"},
        but its loading blank.gif there.

        Am I missing anything?

        Also, If I managed to use these images

        1. Are there any performance implications?
        2. How to get the checked rows?

        Comment


          #5
          See the docs, booleanFalseImage is a property of ListGrid not ListGridField.

          Comment


            #6
            How to get checkbox value when formatted

            Thanks a lot. I managed to render check boxes. I just want to know

            are there any performance implications?

            Comment


              #7
              How to get checkbox value when formatted

              Hey Could you please tell me are there any performance implications?

              Comment

              Working...
              X