How can I disable selected attribute from select2() dropdown Jquery?
The right way for Select2 3.x is: $(‘select’).select2(“enable”, false) This works fine.
The right way for Select2 3.x is: $(‘select’).select2(“enable”, false) This works fine.
Try this : $(‘select[name^=”salesrep”] option[value=”Bruce Jones”]’).attr(“selected”,”selected”); Just replace option[value=”Bruce Jones”] by option[value=result[0]] And before selecting a new option, you might want to “unselect” the previous : $(‘select[name^=”salesrep”] option:selected’).attr(“selected”,null); You may want to read this too : jQuery get specific option tag text Edit: Using jQuery Mobile, this link may provide a good solution : jquery … Read more
The cursor position and selection size are shown in the Info window (F8, in the upper right in my workspace).
the line should be var selectedText = $(this).find(“option:selected”).text();
All the above answers are fine but a bit to complex to my liking. The simplest way to do it is to put some code in the cellForRowAtIndexPath. That way you never have to worry about changing the color when the cell is deselected. override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let … Read more
You can do it calling setRowSelectionInterval : table.setRowSelectionInterval(0, 0); to select the first row.
You should use view models and forget about ViewBag Think of it as if it didn’t exist. You will see how easier things will become. So define a view model: public class MyViewModel { public int SelectedCategoryId { get; set; } public IEnumerable<SelectListItem> Categories { get; set; } } and then populate this view model … Read more
You can set: dataGridView1.FirstDisplayedScrollingRowIndex = dataGridView1.SelectedRows[0].Index; Here is the MSDN documentation on this property.
How are you setting the images for the different UIControlStates on the button? Are you setting a background image for UIControlStateHighlighted as well as UIControlStateSelected? UIImage *someImage = [UIImage imageNamed:@”SomeResource.png”]; [button setBackgroundImage:someImage forState:UIControlStateHighlighted]; [button setBackgroundImage:someImage forState:UIControlStateSelected]; If you’re setting the selected state on the button touch down event rather than touch up inside, your button … Read more