📜  jQWidgets jqxTagCloud sortBy 属性(1)

📅  最后修改于: 2023-12-03 15:32:20.219000             🧑  作者: Mango

jQWidgets jqxTagCloud sortBy Property

The sortBy property of jQWidgets jqxTagCloud is used to define the type of sorting to be applied to the tags in the tag cloud. It accepts a string value that can be set to one of the following options:

  • none: No sorting is applied to the tags.
  • alphabetical: The tags are sorted alphabetically.
  • weight: The tags are sorted based on their weight, with the heaviest tags first.
  • length: The tags are sorted based on their length, with the longest tags first.
How to use

To use the sortBy property, you need to set it as an option when you initialize the jqxTagCloud. Here's an example:

$("#myTagCloud").jqxTagCloud({
  source: myTags,
  sortBy: "weight" // Or any other valid option
});
Examples
Alphabetical sorting
$("#myTagCloud").jqxTagCloud({
  source: myTags,
  sortBy: "alphabetical"
});

This will sort the tags in the tag cloud alphabetically.

Weight sorting
$("#myTagCloud").jqxTagCloud({
  source: myTags,
  sortBy: "weight"
});

This will sort the tags in the tag cloud based on their weight, with the heaviest tags first.

Length sorting
$("#myTagCloud").jqxTagCloud({
  source: myTags,
  sortBy: "length"
});

This will sort the tags in the tag cloud based on their length, with the longest tags first.

Conclusion

The sortBy property of jQWidgets jqxTagCloud is a useful feature that allows you to sort the tags in the tag cloud based on different criteria. It provides flexibility and customization options to the tag cloud, making it a versatile and powerful tool.