Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Render Radio buttons as edittype
- Radio buttons can be shown by custom method.
- $col = array();
- $col["title"] = "Closing Rate";
- $col["name"] = "closed";
- $col["width"] = "30";
- $col["editable"] = true;
- $col["align"] = "center";
- $col["editoptions"]["dataInit"] = "function(o){edit_as_radio(o);}";
- $cols[] = $col;
- ... and in html section, we can define custom edit-type display
- <script>
- function edit_as_radio(o)
- {
- setTimeout(function(){
- jQuery(o).replaceWith('<input type="hidden" id="closed" name="closed" value=""><input title="0" type="radio" name="rd_closed" value="0" onclick="jQuery(\'#closed\').val(0);"/>0 <input title="5" type="radio" name="rd_closed" value="5" onclick="jQuery(\'#closed\').val(5);"/>5 <input title="10" type="radio" name="rd_closed" value="10" onclick="jQuery(\'#closed\').val(10);"/>10');
- },100);
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement