javascript - When click on dropdown item it should show over dashboard and remove from the dropdown list -


i have list of grids not shown on dashboard right , need show these grids on dashboard click on dropdown item should show on dashboard , remove dropdown list. using .hide() of jquery hide item dropdown list. in first case remove items dropdown list.

and have cross button on grid if user can click on cross button item should visible in drop-down list. if repeat steps the item not hide drop-down list.

var name = "#" + e.getattribute("name");             $(name).hide();             var widgetid = "#" + e.getattribute("name") + "widget";             $(widgetid).addclass("widget");             //$("#" + e.getattribute("gridname") + "grid").data('kendogrid').datasource.read();             $(widgetid).show();             createwidgets(); 

i using code remove item grid , redraw grid.

thanks prince chopra

following code idea how fix this,

http://jsfiddle.net/fhcfy/

sample html

<select id="gridselection">     <option value="0">select option</option>     <option value="1">grid 1</option>     <option value="2">grid 2</option>     <option value="3">grid 3</option>     <option value="4">grid 4</option>     <option value="5">grid 5</option> </select> <button id="show">show</button> <div class="gridcontainer">     <div id="grid1">grid 1<span>x</span>         </div>     <div id="grid2">grid 2<span>x</span>         </div>     <div id="grid3">grid 3<span>x</span>         </div>     <div id="grid4">grid 4<span>x</span>         </div>     <div id="grid5">grid 5<span>x</span>         </div> </div> 

javascript,

$(document).on("click", "#show", function (e) {     var selectedgrid = $("#gridselection").val();     $("#gridselection option[value=" + selectedgrid + "]").hide();     $("#gridselection").val(0);     $(".gridcontainer").find("#grid" + selectedgrid).data("option", selectedgrid).show();     });  $(".gridcontainer").on("click", "span", function () {     var grid = $(this).closest("div");     grid.hide();     $("#gridselection option[value=" + grid.data("option") + "]").show(); }); 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -