Announcement

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

    images/checkboxes inside the list grid cell when dataSource is used

    Hi,

    I am creating a Listgrid by the following way:
    1. I am creating a data source, the data source code is
    Code:
    DataSource.create({
    	ID: "countryDS",
        	dataFormat:"xml",
        	dataURL: "/JSP/countryData.xml",
        	recordXPath: "//country",
    fields:[
                {name: "select", title: "Select", width:20},
        	{name: "country", title: "Country", width:50},
        	{name: "state", title: "State", width:80},
        	{name: "city", title: "City", width:80}
    ]
    });
    2. My list grid create code is:
    Code:
    isc.ListGrid.create({
        	ID: "CountryInfo",
        	top: 180,
        	left:10,
        	width:"20%", height:200, showAllRecords:true,
        	dataSource: countryDS,
        	autoFetchData: true,
    	wrapCells: true,
    	fixedRecordHeights: false,
    	showRollOver: false,
    	leaveScrollbarGap: false,
    	canResizeFields: false,
        	bodyOverflow: "hidden",
        	headerHeight: 60,
        	baseStyle: "myBoxedGridCell",
        	selectionType: "none",
        	canReorderFields: false,
        	selectOnEdit:false
    
    });
    My questions are:
    1. Now i want to have checkboxes in the first column "Select", how to achieve it?
    2. If i want to have few images in the first column, how i can achieve that? i saw few examples in feature explorer where images are displayed in a column. In all those examples the fields are defined inside the isc.ListGrid.create code and data is used not dataSource.

    #2
    To create checkboxes, just set the field.type to "boolean". This works in either the DataSource or component fields. You can change the media used for checkboxes, and set them up to toggle with one click.

    Note that you can specify fields both on the component and on the DataSource, as covered under dataBoundComponent.fields.

    Comment

    Working...
    X