开发者

Address-book jQuery support

开发者 https://www.devze.com 2023-03-19 01:29 出处:网络
I have a address book with groups and contacts, and I\'d like to have some sort of jQuery functionality that allows each contact or group to be individually selected, i.e. with a checkbox

I have a address book with groups and contacts, and I'd like to have some sort of jQuery functionality that allows each contact or group to be individually selected, i.e. with a checkbox

Is there a easy way to get the following functionality? (in a jQuery plugin or just plain javascript)

  • Select a whole group of contacts
  • Select all groups,开发者_开发百科 which in order selects all contacts

SMSCity.com has this functionality that I want (see screenshot below)

Address-book jQuery support


just add a css class to each row containing the group name: e.g. group group-friends and then select them by calling

$(".group-" + groupname + " input:checkbox").prop("checked", true);

and to select all contacts, just call:

$(".addressbook tr input:checkbox").prop("checked", true);

or only those which are in a group:

$(".group input:checkbox").prop("checked", true);
0

精彩评论

暂无评论...
验证码 换一张
取 消