求大神给个easyui的联动教学,最好是java语言的
就比如部门联动那种的,需要数据库,貌似看到过数据库里增加父类pkid字段就可以实现联动,但是不知道具体实现方法谢谢各位大神了...
就比如部门联动那种的,需要数据库,貌似看到过数据库里增加父类pkid字段就可以实现联动,但是不知道具体实现方法
谢谢各位大神了 展开
谢谢各位大神了 展开
2个回答
展开全部
JERRY90
TONY90
TOM89
--------------------------------------------------------
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;
public class Test {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String line = sc.nextLine();
String[] array = line.split("[\\|]");
List<User> list = new ArrayList<User>();
for (int i = 0; i < array.length; i ) {
String[] content = array[i].split(":");
if (content.length != 2) {
continue;
}
User user = new User();
user.name = content[0];
user.chengji = Integer.parseInt(content[1]);
list.add(user);
}
Collections.sort(list, new UserSort());
for (int i = 0; i < list.size(); i ) {
User user = list.get(i);
System.out.println(user.name "\t" user.chengji);
}
}
}
class User {
String name;
int chengji;
}
class UserSort implements Comparator<User> {
public int compare(User u1, User u2) {
if (u2.name.hashCode() != u2.name.hashCode()) {
return u1.name.hashCode() - u2.name.hashCode();
}
return u2.chengji - u1.chengji;
}
}
TONY90
TOM89
--------------------------------------------------------
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;
public class Test {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String line = sc.nextLine();
String[] array = line.split("[\\|]");
List<User> list = new ArrayList<User>();
for (int i = 0; i < array.length; i ) {
String[] content = array[i].split(":");
if (content.length != 2) {
continue;
}
User user = new User();
user.name = content[0];
user.chengji = Integer.parseInt(content[1]);
list.add(user);
}
Collections.sort(list, new UserSort());
for (int i = 0; i < list.size(); i ) {
User user = list.get(i);
System.out.println(user.name "\t" user.chengji);
}
}
}
class User {
String name;
int chengji;
}
class UserSort implements Comparator<User> {
public int compare(User u1, User u2) {
if (u2.name.hashCode() != u2.name.hashCode()) {
return u1.name.hashCode() - u2.name.hashCode();
}
return u2.chengji - u1.chengji;
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询