Friday, 1 February 2019
Tuesday, 29 January 2019
Bootstrap multiselect with n-option selected at a time
//////////////////////////////// HTML
////////////////////////////// Bootstrap multi-select
<select multiple="multiple" id="ddl_Stations" class="multiselect">
<option value="Alagawadi">Alagawadi</option>
<option value="Attigundi">Attigundi</option>
<option value="Balehonnur.M">Balehonnur</option>
<option value="Bannur">Bannur</option>
<option value="Bennur">Bannur</option>
<option value="Chandapur">Chandapur</option>
</select>
////////////////////////////// Bootstrap multi-select
$(document).ready(function
() {
$('.multiselect').multiselect({
includeSelectAllOption: true,
enableFiltering: true,
maxHeight: 200
});
});
////////////////////////////// Bootstrap multi-select with n-number options
$(document).ready(function
()
{
$('.multiselect').multiselect({
enableFiltering: true,
maxHeight: 400,
enableCaseInsensitiveFiltering: true,
nonSelectedText: 'Select Stations',
numberDisplayed: 2,
selectAll: false,
onChange: function (option, checked) {
// Get selected options.
var selectedOptions = jQuery('.multiselect
option:selected');
if (selectedOptions.length >= 5) {
// Disable all other checkboxes.
var nonSelectedOptions =
jQuery('.multiselect option').filter(function () {
return !jQuery(this).is(':selected');
});
nonSelectedOptions.each(function () {
var input = jQuery('input[value="'
+ jQuery(this).val() + '"]');
input.prop('disabled', true);
input.parent('li').addClass('disabled');
});
}
else {
// Enable all checkboxes.
jQuery('.multiselect
option').each(function () {
var input = jQuery('input[value="'
+ jQuery(this).val() + '"]');
input.prop('disabled', false);
input.parent('li').addClass('disabled');
});
}
}
});
});
Reset bootstrap multiselect listbox using jquery
////////////////////////////////// HTML
///////////////// After render HTML
////////////////////////////////// Jquery multi selecte
//////////////////////////// Jquery Reset
<select multiple="multiple" id="ddl_Stations" class="multiselect">
<option value="Alagawadi">Alagawadi</option>
<option value="Attigundi">Attigundi</option>
<option value="Balehonnur.M">Balehonnur</option>
<option value="Bannur">Bannur</option>
<option value="Bennur">Bannur</option>
<option value="Chandapur">Chandapur</option>
</select>
///////////////// After render HTML
<li class=""><a
href="javascript:void(0);">
<label
class="checkbox">
<input type="checkbox"
class="ace"
value="Alagawadi"><span class="lbl"></span> Alagawadi
</label>
</a></li>
$(document).ready(function
() {
$('.multiselect').multiselect({
includeSelectAllOption: true,
enableFiltering: true,
maxHeight: 200
});
});
//////////////////////////// Jquery Reset
$(".multiselect
option:selected").prop("selected",
false);
$('.multiselect option').each(function () {
var
input = $('input[value="' + $(this).val() + '"]');
input.removeAttr('checked');
input.removeClass('active');
input.prop('disabled', false);
input.closest('li').removeClass('active');
input.parent('li').removeClass('active');
});
$('.btn-group .dropdown-toggle').text('Select Stations')
Sunday, 27 January 2019
Split string In sql server Get table format
////////////////////
CREATE FUNCTION [dbo].[SplitString_TableFormat]
(
@String NVARCHAR(4000),
@Delimiter NCHAR(1)
)
RETURNS TABLE
AS
RETURN
(
WITH Split(stpos,endpos)
AS(
SELECT 0 AS stpos, CHARINDEX(@Delimiter,@String) AS endpos
UNION ALL
SELECT endpos+1, CHARINDEX(@Delimiter,@String,endpos+1)
FROM Split
WHERE endpos > 0
)
SELECT 'Id' = ROW_NUMBER() OVER (ORDER BY (SELECT 1)),
'Value' = SUBSTRING(@String,stpos,COALESCE(NULLIF(endpos,0),LEN(@String)+1)-stpos)
FROM Split
)
//////////////////////// Call function
SELECT a.Name,a.Name1, b.value
FROM TableName a
JOIN STRING_SPLIT('316,317,318,319,320,321,322,323,324,325,326,327,328,329,330', ',') AS b ON a.value = b.value
Monday, 31 December 2018
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AI" in the equal to operation.
//////////////
select * from [DBName].[dbo].[tableName_1] t inner join [DBName].[dbo].[tableName_2] b on a.ColumnName COLLATE DATABASE_DEFAULT
=b.ColumnName COLLATE DATABASE_DEFAULT
Friday, 28 December 2018
The test form is only available for requests from the local machine.
////////////////////
<configuration>
<system.web>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
</system.web>
</configuration>
Subscribe to:
Posts (Atom)
How to highlight selected text in notepad++
–> To highlight a block of code in Notepad++, please do the following steps step-1 :- Select the required text. step-2 :- Right click...
-
Encryption / Decryption: Encryption is the process of translating plain text data into something that appears to be random and...
-
//////// CSS < style > .validated_ok { border : 1px solid green } .validated_error { border : 1px solid red } .validate...
-
Excel :: Text :: 1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula :: TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...