您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

46 行
1.2 KiB

  1. wn.ui.form.LinkSelector = Class.extend({
  2. _help: "Dialog box to select a Link Value",
  3. init: function(opts) {
  4. /* help: Options: doctype, get_query, target */
  5. $.extend(this, opts);
  6. var me = this;
  7. if(this.doctype!="[Select]") {
  8. wn.model.with_doctype(this.doctype, function(r) {
  9. me.make();
  10. });
  11. } else {
  12. this.make();
  13. }
  14. },
  15. make: function() {
  16. this.dialog = new wn.ui.Dialog({
  17. "title": "Select " + this.doctype,
  18. "fields": [
  19. {
  20. fieldtype: "Data", fieldname: "txt", label: "Beginning with",
  21. description: "You can use wildcard %"
  22. },
  23. {
  24. fieldtype: "Select", fieldname: "search_field", label: "Search With"
  25. },
  26. {
  27. fieldtype: "Button", fieldname: "search", label: "Search",
  28. },
  29. {
  30. fieldtype: "HTML", fieldname: "results"
  31. }
  32. ]
  33. });
  34. var search_fields = wn.model.get_value("DocType", this.doctype, "search_fields");
  35. if(this.doctype!="[Select]" && search_fields) {
  36. this.dialog.fields_dict.search_field.$input.add_options(search_fields.split(","));
  37. } else {
  38. this.dialog.fields_dict.search_field.$wrapper.toggle(false);
  39. }
  40. this.dialog.fields_dict.search.$input.on("click", function() {
  41. })
  42. this.dialog.show();
  43. }
  44. })