browsestoryconcept.ui.js 872 B

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * 对部分列进行重定义。
  3. * Redefine the partial column.
  4. *
  5. * @param array result
  6. * @param array info
  7. * @access public
  8. * @return string|array
  9. */
  10. window.renderCell = function(result, info)
  11. {
  12. if(info.col.name == 'default')
  13. {
  14. const checked = defaultKey == info.row.data.key ? 'checked' : '';
  15. result[0] = {html: `<input type='radio' name='default' value=${info.row.data.key} ${checked} class='cursor-pointer'>`};
  16. return result;
  17. }
  18. if(info.col.name == 'actions' && defaultKey == info.row.data.key)
  19. {
  20. result[0]['props']['items'][1]['disabled'] = true;
  21. return result;
  22. }
  23. return result;
  24. }
  25. $(document).off('change', 'input[name=default]').on('change', 'input[name=default]', function(e)
  26. {
  27. $.ajaxSubmit({url: $.createLink('custom', 'setDefaultConcept', 'key=' + $(e.target).val())});
  28. })