PDA

View Full Version : default value for a column


jbowman
11-15-2006, 09:12 PM
Maybe there's already a way to do this, but I haven't figured it out. What I'd like to do is have a default value for a column in the grid, specifically a loadabledatamodule. Basically, here's the JSON I'm returning right now.


{"totalCount": "2",

"Users": [

{"id": "7", "username": "testcom", "email": "test@test.com", "level": "10", "birthday": "1987-11-12", "join_date": "2006-11-12", "last_login": "0000-00-00", "edit": "/ci/css/images/icons/edit.gif", "ban": "/ci/css/images/icons/ban.gif"},
{"id": "4", "username": "testorg", "email": "test@test.org", "level": "10", "birthday": "1987-11-09", "join_date": "0000-00-00", "last_login": "2006-11-14", "edit": "/ci/css/images/icons/edit.gif", "ban": "/ci/css/images/icons/ban.gif"}
]}


Those last two columns are so I can display images that will have cellclick events on them. I'm looking for a way to set those as the value when I define the column, so I don't have to return them with every page load.

jack.slocum
11-16-2006, 12:24 AM
The best way to do that is with a CSS background image.

#your-grid .ygrid-col-4 {
background: #fff url(/ci/css/images/icons/ban.gif) no-repeat center;
}

You could also use a renderer function.

You could also use a preprocessor function.

There's a lot of ways to do it. :)

jbowman
11-16-2006, 06:58 AM
the css idea makes the most sense, thanks Jack :)