Posts

Showing posts from July, 2014

Cannot read property 'fnSetData' of undefined

  I have a Jquery Datatable in one of my MVC view. When I tried to load the Datatable I got the following error. Cannot read property 'fnSetData' of undefined Problem in my case was my table header and the table body content was not matching. ex: < table cellpadding ="0" cellspacing ="0" border ="0" class ="display" id ="TBL_WorkAreaManagementSearchResults" style ="width: 100%" > < thead > < tr > < th ></ th > < th > WorkArea </ th > < th > Region </ th > </ tr > </ thead > < tbody > @foreach (var workArea in Model) { < tr >

Editable List box in HTML

  I have recently came across a requirement where  a list of objects need to be added and edited. That object has only two fields which is name & id. So there is no point of using a editable data table as well. Following is the solution I came across. Create a List box Add a text box and a button which will add new items to the list box. On click on list box item load a pop up which allows user to edit the items.   Code for generating Listbox at the View < div >                         < select size ="10" id ="workAreas" multiple >                          @ foreach ( var item in Model.WorkAreas)                          {                                             < option id ="option_ @ item.Id " value =" @ item.Id " onclick ="new RegionManagement().OnWorkAreaEdit( @ item.Id );" class ="TextBoxLarge">                                  @ item.Name                              </ optio