RoadFlow2.1 临时演示

roadui.selectico.js 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //选择图标
  2. ;RoadUI.SelectIco = function (options)
  3. {
  4. var instance = this;
  5. var defaults = {
  6. obj: null,
  7. x: true
  8. };
  9. this.opts = $.extend(defaults, options);
  10. var $source = $(this.opts.obj);
  11. var validate = $source.attr('validate');
  12. var val = $source.val();
  13. var id = $source.attr('id');
  14. var name = $source.attr('name');
  15. var more = $source.attr('more');
  16. var source = $source.attr("source"); //| 设置数据源{GUID 或 Code}
  17. var title = $source.attr("title");
  18. if (title == null || title == undefined) title = "选择图标";
  19. if (name == null || name == undefined) name = id;
  20. more = more == null || more == undefined ? "0" : more.toLowerCase() == "true" || more == "1" ? "1" : "0";
  21. source = source == null || source == undefined ? "" : source;
  22. $source.removeClass().addClass("mytext");
  23. $source.prop("readonly", true);
  24. var $but = $('<input type="button" class="mybutton" style="border-left:none;margin:0;" value="选择" />');
  25. var $label = $('<label type="msg"></label>');
  26. if ($source.prop("disabled"))
  27. {
  28. $but.prop("disabled", true);
  29. }
  30. else
  31. {
  32. $but.bind('click', function ()
  33. {
  34. new RoadUI.Window().open({
  35. id: "ico_" + id, title: title, width: 600, height: 406,
  36. url: top.rootdir + '/Controls/SelectIco/Default.aspx?more=' + more + '&id=' + id + '&source=' + source + '&values=' + val, openerid: RoadUI.Core.query("tabid")
  37. });
  38. });
  39. }
  40. $source.after($but, $label);
  41. }