Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
fill jqgrid with java object list
19/08/2011
16:19
Avatar
yellowduckbear
Member
Members
Forum Posts: 4
Member Since:
19/08/2011
sp_UserOfflineSmall Offline

I have the follow

public class Car {
private Long id;
private String owner;
private CarEnums type;

public Car(Long id, String owner, CarEnums type){
this.id = id;
this.owner = owner;
this.type = type;
}

public void setId(Long id) {
this.id = id;
}

public Long getId() {
return id;
}

public String getOwner() {
return owner;
}

public void setOwner(String owner) {
this.owner = owner;
}

public void setType(CarEnums type) {
this.type = type;
}
public CarEnums getType() {
return type;
}

}

I fill an ArrayList of car in CarList.java

carList.add(new Car(1L, "KiT", CarEnums.JAGUAR));
carList.add(new Car(2L, "KoT", CarEnums.JAGUAR));
carList.add(new Car(3L, "KiT", CarEnums.RENAULT))

I made carlist.jsp. I wanna use carList in this jsp to fill JQGrid with data.

jQuery("#carTable").jqGrid({

datatype: "clientSide",

height: 500,

colNames:['Name','Type'],

colModel:[{name:'name',index:'name', width:200, sorttype:"string"},

{name:'type',index:'type', width:50, sorttype:"string"},],

pager: jQuery('#campTablePager'),c

aption: "Car List" });

jQuery("#carTable").addRowData(1, {id: 1, name:carList[1].name() , type:carList[1].type});

How can I use carList java ArrayList? For example how can I read carList[i].name(), carList[i].type().ToString() in for cycle? 

Thanks 
KiT 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
83 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information