Html Span Checkbox Kontrolü
Html Span Checkbox Kontrolü
Html Kodu:class='inactive chkboxhandler' onclick='checkClick("Accounting")'>type='checkbox' id='checkAccounting' class='chkbox' name='checkBoxes' />='checkAccounting'>Accounting
stringnameSpaces = Request.QueryString["NameSpaces"];
List<string> nameSpaceList = new List<string>();
nameSpaceList = new List<string>(nameSpaces.Split(','));
JS Kodu:
/*customchk*/
$(".chkboxhandler").bind("click", function () {
var _mychkBox = $(this).find(".chkbox");
if (_mychkBox.is(':checked')) {
$(this).removeClass('active').addClass('inactive');
$(this).find(".chkbox").attr('checked', false);
}else {
$(this).removeClass('inactive').addClass('active');
$(this).find(".chkbox").attr('checked', true);
}
namespaces = getNamespaces(); checkClick2(namespaces);
})
})function getNamespaces() {
var namespaceList = [];
$(".chkboxhandler").each(function () {
if ($(this).hasClass('active')) {
var chkBox = $(this).find(".chkbox");
var id = $(chkBox).attr('id');
var text = $("label[for='" + id + "']").text();
namespaceList.push(text);
}
});return namespaceList.join(',');
}function checkClick2(ns) {
$.ajax({
type: "GET",
url: "SandCastleSearch.aspx",
contentType: "application/html; charset=utf-8",
dataType: "html",
data: "Keywords=" + $("#txtExpression").val() + "&Namespaces=" + ns,
cache: false,
success: function (data) {
var resultReport = $(data).find('#resultReport');
var contentlist = $(data).find('#contentlist');
var contentFooter = $(data).find('#contentFooter');
$("#contentResult").empty().append(resultReport).append(contentlist).append(contentFooter);
}
});
}

Yorumlar
Yorum Gönder