PDA

View Full Version : Sorting by IP adress on GridPanel



pirusira
21 Apr 2010, 5:55 PM
This is my GridPanel


var grid = new Ext.grid.GridPanel({
renderTo: Ext.getBody(),
frame:true,
title: 'SH',
height:530,
width:500,
loadMask: true,
store: store,
columns: [
{header: "IP", dataIndex: 'ip', sortable: true},
{header: "ModelName", dataIndex: 'modelName', sortable: true},
{header: "StateText", dataIndex: 'stateText', sortable: true},
{header: "GroupName", dataIndex: 'groupName', sortable: true}
],
bbar: new Ext.PagingToolbar({
pageSize: myPageSize,
store: store
})
});
I wanted to sort my grid by IP address but it worked like this
192.168.1.10
192.168.1.2
192.168.1.20
192.168.1.3

The order I wanted is
192.168.1.2
192.168.1.3
192.168.1.10
192.168.1.20

Actually I read the post of this problem in the forum, but I didn't understand it.
I'm looking forward to an explanation in more detail & easier manner with example code.

Thank you=;

Animal
21 Apr 2010, 9:05 PM
http://www.extjs.com/deploy/dev/docs/?class=Ext.data.Field&member=sortType