Sunday, 27 December 2020
Tuesday, 12 March 2019
DataTable
//Setting json from direct ajax request
//Setting json from direct ajax request
$.ajax({
url: "/home/EventsNonReproList",
contentType: "application/json",
beforeSend: function () {
},
success: function (result) {
if (result.length > 0) {
listOfEventsNonRepro = result;
$('#example2').DataTable({
data: result,
deferRender: true,
scrollY: 400,
scrollCollapse: true,
scroller: true,
ordering: false,
//createdRow: function (row, data, index) {
// if (NonReproOnlyEvents.filter(x => x.sno == data.sno).length > 0) {
// $(row).addClass('red ' + data.sno);
// }
//},
search: {
"caseInsensitive": true
},
columns: [
{ "data": "sno" },
{ "data": "message" }
]
});
$("#example2_filter").hide();
}
}
});
// For search :
var table = $('#example').DataTable();
table.search($("#searchCriteria").val()).draw();
//Setting json from other ajax and settign to data object in DataTable :
var table2 = $('#example2').DataTable();
table2.data-yourJSON;
table2.draw();
Sunday, 3 February 2019
var shell = PowerShell.Create();
var sxr = File.ReadAllText(@"C:\Users\vinod\Desktop\demo.ps1");
// Add the script to the PowerShell object
shell.Commands.AddScript(File.ReadAllText(@"C:\Users\vinod\Desktop\demo.ps1"));
// Execute the script
var results = shell.Invoke();
var middleIndex = Math.Round((decimal)(results.Count()/ 2));
foreach (var qq in results )
{
var a = qq.Members["InputObject"];
var b = qq.Members["SideIndicator"];
}
<Reference Include="System.Management.Automation" />
$book1=Get-Content "C:\Users\vinod\Desktop\planes.xml"
$book1=$book1 | Foreach {$_.Trim()}
$book2=Get-Content "C:\Users\vinod\Desktop\planes2.xml"
$book2=$book2 | Foreach {$_.Trim()}
Compare-Object $book1 $book2
var sxr = File.ReadAllText(@"C:\Users\vinod\Desktop\demo.ps1");
// Add the script to the PowerShell object
shell.Commands.AddScript(File.ReadAllText(@"C:\Users\vinod\Desktop\demo.ps1"));
// Execute the script
var results = shell.Invoke();
var middleIndex = Math.Round((decimal)(results.Count()/ 2));
foreach (var qq in results )
{
var a = qq.Members["InputObject"];
var b = qq.Members["SideIndicator"];
}
<Reference Include="System.Management.Automation" />
$book1=Get-Content "C:\Users\vinod\Desktop\planes.xml"
$book1=$book1 | Foreach {$_.Trim()}
$book2=Get-Content "C:\Users\vinod\Desktop\planes2.xml"
$book2=$book2 | Foreach {$_.Trim()}
Compare-Object $book1 $book2
Subscribe to:
Posts (Atom)