Paging property missing in Status - linq-to-twitter

In latest version of LINQ to Twitter v2.1.08 there is no longer support for paging. How do I get a certain page without page property?
Cheers
int curPageIndex=5;
string pageindex="5";
string cmd = "next";
using (var twitterCtx = new TwitterContext(myauth))
{
try
{
// set up the "main query"
IQueryable<Status> test = from tweet in twitterCtx.Status select tweet;
switch (cmd)
{
case "prev":
test = pageindex.Length > 0
? test.Where(p => p.Type == StatusType.Home && p.Page == curPageIndex)
: test.Where(p => p.Type == StatusType.Home);
break;
case "next":
test = pageindex.Length > 0
? test.Where(p => p.Type == StatusType.Home && p.Page == curPageIndex)
: test.Where(p => p.Type == StatusType.Home);
break;
default:
//
test = test.Where(p => p.Type == StatusType.Home);
break;
}

Solution: Changed Page parameter to SinceID and MaxID
//Get the statusids in the query, add or subtract so you skip current id's
ulMaxId = test.Min(status => ulong.Parse(status.StatusID)) - 1;
ulSinceID = test.Max(status => ulong.Parse(status.StatusID)) + 1;
//Return ID above and use them in future calls (below)
//Now you can navigate timelines, depending if you are stepping forward or backwards
? test.Where(p => p.Type == StatusType.Home && p.SinceID == ulong.Parse(sinceid)
...
? test.Where(p => p.Type == StatusType.Home && p.MaxID == ulong.Parse(maxid))

Related

hiding row of kendo grid after saving mvc 3

im having trouble on solving an issue in my project right now. heres a scenario: im a worker and i want to apply for a shift for a position(ex. monday 8am - 12nn). then it will disappear in my grid after i applied. my problem is i want to display the shift again if other worker logs in and they can applyif they want to apply to that shift.
here's my code:
controller:
public JsonResult LoadCustomerPositionShiftWorkerList(int? clientCusPosId, int? clientId)
{
List<userWorkerCompare> workerDetails = new List<userWorkerCompare>();
GlobalVariables.SiteMapFile = "ClientSiteMapProvider";
MembershipUser membershipUser = Membership.GetUser();
string userId = membershipUser.ProviderUserKey.ToString();
var workerIdList = new List<Int32>();
var customerPositionShiftList = new List<Client_Customer_Position_Shift>();
List<ClientCustomerPositionShiftInfo> clientCustomerPositionShiftList = new List<ClientCustomerPositionShiftInfo>();
var filterList = (from a in db.Worker_Customer_Apply_Shift
where a.LogicalDelete == false && a.Client_Customer_PositionID == clientCusPosId
select a).ToList();
//this is to get workerId
if (Roles.IsUserInRole("Worker"))
{
var listWorker = (from a in db.Workers
where a.LogicalDelete == false
select new
{
a.ID,
a.userId,
a.FirstName,
a.LastName,
a.MiddleName,
a.BirthDate,
a.Gender_LookID,
a.LogicalDelete
}).ToList();
if (listWorker.Count() > 0)
{
foreach (var row in listWorker)
{
var cli = new userWorkerCompare
{
ID = row.ID,
FirstName = row.FirstName,
MiddleName = row.MiddleName,
LastName = row.LastName,
LogicalDelete = row.LogicalDelete,
userId = row.userId.ToString()
};
workerDetails.Add(cli);
}
var workerProfile = (from a in workerDetails
join b in db.Workers
on a.ID equals b.ID
where a.LogicalDelete == false && a.userId == userId
select b).SingleOrDefault();
ViewBag.WorkerProfile = workerProfile;
var workerAvail = (from a in db.Worker_Availability
where a.LogicalDelete == false
&& a.Worker_ID == workerProfile.ID
select a).ToList();
ViewBag.WorkerAvail = workerAvail;
var workerId = (from a in workerDetails
where a.LogicalDelete == false && a.userId == userId
select a.ID).SingleOrDefault();
ViewBag.WorkerId = workerId;
//this is to compare customer position shift from worker availability
if (clientCusPosId.HasValue)
{
customerPositionShiftList = (from a in db.Client_Customer_Position_Shift
where a.LogicalDelete == false && a.Client_Customer_PositionID == clientCusPosId
select a).ToList();
foreach (var row in customerPositionShiftList)
{
var workerList = (from a in db.Worker_Availability
where a.LogicalDelete == false && a.Worker_ID == workerProfile.ID
select a).ToList();
foreach (var Availability in workerList)
{
if (Availability.AvailableDay_LookID == row.Day_LookID || Availability.AvailableDay_LookID == 76 || row.Day_LookID == 76)
{
if (((Availability.StartTime == "Anytime" && Availability.EndTime == "Anytime") || (row.StartTime == "Anytime" && row.EndTime == "Anytime")) ||
(row.StartTime == "Anytime" || row.EndTime == "Anytime") || (Availability.StartTime == "Anytime" || Availability.EndTime == "Anytime"))
{
workerIdList.Add(row.ID);
}
else
{
DateTime availStartTime = Convert.ToDateTime(Availability.StartTime);
DateTime posStartTime = Convert.ToDateTime(row.StartTime);
DateTime availEndTime = Convert.ToDateTime(Availability.EndTime);
DateTime posEndTime = Convert.ToDateTime(row.EndTime);
if ((Availability.StartTime == row.StartTime &&
Availability.EndTime == row.EndTime) || (Availability.StartTime == row.StartTime ||
Availability.EndTime == row.EndTime) || (availStartTime < posStartTime && availEndTime > posEndTime))
{
workerIdList.Add(row.ID);
}
}
}
}
}
}
//to show compared list
var toBeList = (from a in customerPositionShiftList
where a.LogicalDelete == false
select a).ToList();
//after applying this one triggers to hide the row
var setToList =
toBeList.Select(x => x.ID).Except(filterList.Select(y => y.clientCusPosShiftId)).ToList();
var cusWorkList = (from a in db.Client_Customer_Position_Shift
where a.LogicalDelete == false
&& workerIdList.Contains(a.ID)
&& setToList.Contains(a.ID)
select new
{
a.ID,
a.Client_CustomerID,
a.Client_Customer_PositionID,
a.Day_LookID,
a.EndTime,
a.StartTime,
a.LogicalDelete
}).ToList();
if (cusWorkList.Count() > 0)
{
foreach (var row in cusWorkList)
{
ClientCustomerPositionShiftInfo ccpsi = new ClientCustomerPositionShiftInfo
{
ID = row.ID,
ClientID = clientId.HasValue ? clientId.Value : 0,
Client_Customer_PositionID = row.Client_Customer_PositionID,
Client_CustomerID = row.Client_CustomerID,
Day = GetLookupDisplayValById(row.Day_LookID),
StartTime = row.StartTime != "Anytime" ? Convert.ToDateTime(row.StartTime).ToString("hh:mm tt") : row.StartTime.Trim(),
EndTime = row.EndTime != "Anytime" ? Convert.ToDateTime(row.EndTime).ToString("hh:mm tt") : row.EndTime.Trim(),
DayID = (row.Day_LookID)
};
clientCustomerPositionShiftList.Add(ccpsi);
}
}
}
}
return Json(clientCustomerPositionShiftList.ToList().OrderBy(p => p.DayID), JsonRequestBehavior.AllowGet);
}
script:
<script type="text/javascript">
$(document).ready(function () {
var comparegrid = $("#positionShiftWorkerComparedGrid").kendoGrid({
scrollable: false,
sortable: true,
pageable: true,
dataSource: {
transport: {
read: {
url: '/Customer/LoadCustomerPositionShiftWorkerList?clientCusId=' + clientCusId + '&clientId=' + clientId + '&clientCusPosId=' + clientCusPosId,
dataType: "json",
type: "POST"
}
},
pageSize: 10
},
rowTemplate: kendo.template($("#positionShiftWorkerComparedTemplate").html().replace('k-alt', '')),
altRowTemplate: kendo.template($("#positionShiftWorkerComparedTemplate").html())
});
});
</script>
this code works for one user only..i want to hide and unhide data in my kendo grid for different log in .
hope someone could help me.
thanks

if /else condition inside foreach

I am developing an angular project.
I have a table file I want to compare each element with a data value if it is correct I will do statement else I will do another comportement but my problem is that even the data is correct it always fetches all the table and should access in the else for a very short time.
How to avoid that, please.
Here is my code:
if (this.data) {
this.imgNotFoundText = '';
this.data.package.files.forEach(element => {
i++;
this.picture = '';
if (element.name == this.data.properties.Name) {
this.picture = 'picOne.png'
}
if (i == this.data.package.files.length && this.picture == '') {
this.picture = './../assets/img/notFound.jpg'
}
});
}
I see a couple of possible problems:
It seems suspect to always do this.picture = ''; unconditionally in the loop. If you're going to do that, you may as well only look at the last entry in the array. You probably want to move that to before the forEach call.
You've referred to an else, but there is no else in your code. You have two ifs in a row, but the result of the first if doesn't have any effect at all on the second one. You may have wanted else if. Then, the second if isn't performed if the condition in the first if was true.
So if both of those guesses are right:
if (this.data) {
this.imgNotFoundText = '';
this.picture = '';
this.data.package.files.forEach(element => {
i++;
if (element.name == this.data.properties.Name) {
this.picture = 'picOne.png'
} else if (i == this.data.package.files.length && this.picture == '') {
this.picture = './../assets/img/notFound.jpg'
}
});
}
Side note: You haven't shown how i is initialized, but if it's used to track the index of the current entry of the forEach, there's no need: forEach receives that as a second argument:
if (this.data) {
this.imgNotFoundText = '';
this.picture = '';
this.data.package.files.forEach((element, index) => {
// -----------------------------^^^^^^^^^^^^^^^^
if (element.name == this.data.properties.Name) {
this.picture = 'picOne.png'
} else if (index == this.data.package.files.length && this.picture == '') {
// ------------^^^^^
this.picture = './../assets/img/notFound.jpg'
}
});
}
You also might want to avoid that second if altogether, by just specifying the "not found" default before the loop:
if (this.data) {
this.imgNotFoundText = '';
const {files} = this.data.package;
this.picture = files.length ? './../assets/img/notFound.jpg' : '';
files.forEach(element => {
if (element.name == this.data.properties.Name) {
this.picture = 'picOne.png'
}
});
}
In that I've assumed this.picture should be '' if there are no entries in files, or the "not found" image if there's at least one entry. The loop will overwrite it if it finds a match.
Continuing from there, unless there can be multiple entries in files with the same name, you probably want to stop as of the first match. So:
if (this.data) {
this.imgNotFoundText = '';
const {files} = this.data.package;
this.picture = files.length ? './../assets/img/notFound.jpg' : '';
for (const {name} of files) {
if (name == this.data.properties.Name) {
this.picture = 'picOne.png'
break;
}
}
}
Not sure what your goal is but you're just iterating through the list and setting the picture value every time, this means you'll have as result the last element's picture value.
If your goal is to display a "not found" picture for elements who don't have files, you need to have an array of pictures that reflects the array of files (or add a property picture to each file).
Looks like you can use Array.prototype.some
if (this.data) {
this.imgNotFoundText = '';
this.picture = this.data.package.files.some(
(element) => element.name === this.data.properties.Name
) ? 'picOne.png' : './../assets/img/notFound.jpg'
}
It'll return picOne.png if any of the items in data.package.files has a name that is same as this.data.properties.Name or it'll return notFound.jpg
Although that could

Javascript Search Engine AND clause

I'm writing up a search engine with JS and jQuery rather than resulting to my PHP database but i'm having an issue understanding how I will construct the 'query'.
Currently, the following steps are taken to fill the array of objects.
1) PHP backend develops a JSON file with all holidays in a specific database.
2) The Javascript frontend pulls this JSON and adds all of it to an array through a loop.
3) The user has a few boxes where they can search the array with and all the results are added to a 'results' array which is updated accordingly each time.
One issue i'm having is; how do I deal with multiple if clauses?
For example, if both search_time and search_state != "all", I would need to narrow the search down to only include objects where search_time AND search_state values are met. Currently the query is an OR query.
I come from a background of SQL so approaching Javascript like search is a bit different for me, any help would be appreciated.
Javascript search below:
for (var i=0; (i <= holidays.length) && (found < limit); i++) {
var h = holidays[i];
console.log(h);
complete = false;
while (!complete && (h != undefined)) {
if (search_terms != "" && search_terms != undefined) {
if (like(h.title, search_terms) || like(h.state, search_terms) || like(h.country, search_terms) || like(h.location, search_terms)) {
results[found] = h;
found += 1;
complete = true;
}
}
if (search_country != "all") {
if (h.country != undefined) {
if (like(h.country, "Australia") && !complete) {
results[found] = h;
found += 1;
complete = true;
}
}
}
if (search_state != "ALL") {
if (like(h.state, search_state) && !complete) {
results[found] = h;
found += 1;
complete = true;
}
}
if (search_time != "all") {
var cyear = new Date().getFullYear();
var nyear = cyear + 1;
if (search_time == 'n-year' && !complete) {
if (h.startsyd != undefined) {
if (new Date(h.startsyd).getFullYear() >= nyear) {
results[found] = h;
found += 1;
complete = true;
}
}
else if (h.melbstart != undefined) {
if (new Date(h.melbstart).getFullYear() >= nyear) {
results[found] = h;
found += 1;
complete = true;
}
}
}
else if (search_time == 'c-year' && !complete) {
if (h.startsyd != undefined) {
if (new Date(h.startsyd).getFullYear() >= cyear && new Date(h.startsyd).getFullYear() < nyear) {
results[found] = h;
found += 1;
complete = true;
}
}
else if (h.melbstart != undefined) {
if (new Date(h.melbstart).getFullYear() >= cyear && new Date(h.melbend).getFullYear() < nyear) {
results[found] = h;
found += 1;
complete = true;
}
}
}
else if (search_time == '6-months' && !complete) {
var six = new Date().setMonth(this.getMonth() + 6);
if (h.startsyd != undefined) {
if (new Date(h.startsyd <= six)) {
results[found] = h;
found += 1;
complete = true;
}
}
else if (h.melbstart != undefined) {
if (new Date(h.melbstart <= six)) {
results[found] = h;
found += 1;
complete = true;
}
}
}
else if (search_time == '3-months' && !complete) {
var three = new Date().setMonth(this.getMonth() + 3);
if (h.startsyd != undefined) {
if (new Date(h.startsyd <= three)) {
results[found] = h;
found += 1;
complete = true;
}
}
else if (h.melbstart != undefined) {
if (new Date(h.melbstart <= three)) {
results[found] = h;
found += 1;
complete = true;
}
}
}
}
complete = true;
}
}
this way will allows you to:
1) add more field comparisons (read about items marked with number 4.a and 4.b, you can add 4.c, 4.d etc.., trying to keep things clear).
2) allows you to select in AND or OR modes (with sensitivity)
3) Save you a lot of time and code by using jQuery.
4) a strstr function is provided, read the scripts sections for comments. The original function (link) returns a string, i make a modification to it by returning a null instead of a "No match" string.
// 1. lets setup a database, you can pull it from PHP or some other else..
//
var holidays = [
{ title : "aaskjqkwqiuwqi" , state : "florida" },
{ title : "aaaaksjak222jski" , state : "california" },
{ title : "1281827888282" , state : "california" },
{ title : "aksjakjkas88112" , state : "florida" }
];
// 2. lets define some inputs
//
var i_find = "88"; // what to find
var i_state = "all"; // what to find
// 3. define some internal conditions.
//
var result_type = 'AND'; // set to: AND or OR
var at_least = 2; // when OR, at least N items to have a match..
var results = [];
// 4. for each holiday entries we will count how many conditions match,
// and depending on the search modality (AND or OR) then we put results
//
$(holidays).each(function(index,obj){
var matches = [];
// 4.a find by title and say if it success or not
matches.push({ res: strstr(obj.title, i_find) ? true : false });
// 4.b find by state, and again, say if it success or not
if("all" != i_state)
matches.push({ res: strstr(obj.state, i_state) ? true : false });
// 4.c more search attributes ? add them here
// 5. process results
// we will count how many questions (4a,4b..) success:
var n_matches = 0;
$(matches).each(function(i,o){ if(true == o.res) n_matches++; });
// 5.b return results depending on the search model: AND or OR,
//
if(('AND' == result_type) && (n_matches == matches.length))
results.push(obj);
if(('OR' == result_type) && (n_matches > at_least))
results.push(obj);
});
// 6. we have results, if 'results' has entries.
console.log('Search Type: '+result_type);
results.length ? console.log('WE HAVE A MATCH FOR:'
+i_find+' please examine results array')
: console.log('NO MATCH');
if(results.length) console.log(results);
// 7. have a nice day. :)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script>
/* taken from: https://stackoverflow.com/a/9123997/937815 */
function strstr (haystack, needle) {
var i = 0,
tempLength = 0,
temp = [];
for (;;) {
if (haystack[i] === undefined || needle == null) {
return null;
}
//if the char doesn't match then reset
else if (haystack[i] !== needle[tempLength]) {
temp = [];
tempLength = 0;
}
//the char matches so let's store it.
else if (haystack[i] === needle[tempLength]) {
temp[tempLength] = haystack[i];
if (needle[tempLength + 1] === undefined) {
return temp;
}
tempLength++;
}
i++;
}
};
</script>

How to pass datasource to a datagrid view present in a table view panel

I am also using entity framework and I am getting data in a list and using that list as data source for windows application.
I am trying to pass data source, and the code is working properly too but I can not see data on the screen.
using (hr = new HearingAidSolutionEntities())
{
List<ClientDetail> c = hr.ClientDetails.Where(a => a.DateOfBirth.Day == dateTimePickerDate.Value.Day && a.DateOfBirth.Month == dateTimePickerDate.Value.Month).ToList();
buttonNotification.Text = c.Count.ToString() + " People BirthDays..";
List<Schedule> sc = hr.Schedules.Where(n => n.Date.Day == dateTimePickerDate.Value.Day && n.Date.Month == dateTimePickerDate.Value.Month && n.Date.Year == dateTimePickerDate.Value.Year).ToList();
buttonSchedule.Text = sc.Count.ToString() + " Schedules";
List<ToDo> To = hr.ToDoes.Where(m => m.Date.Day == dateTimePickerDate.Value.Day && m.Date.Month == dateTimePickerDate.Value.Month && m.Date.Year == dateTimePickerDate.Value.Year).ToList();
buttonToDo.Text = To.Count.ToString() + " Things To Do Today";
List<BillDetail> dd = hr.BillDetails.Where(d => d.IsApproved == 1).ToList();
dataGridViewOrderReceivedApproval.DataSource = dd;
dataGridViewOrderReceivedApproval.Columns[0].Visible = false;
dataGridViewOrderReceivedApproval.Columns[3].Visible = false;
dataGridViewOrderReceivedApproval.Columns[6].Visible = false;
dataGridViewOrderReceivedApproval.Columns[7].Visible = false;
dataGridViewOrderReceivedApproval.Columns[9].Visible = false;
dataGridViewOrderReceivedApproval.Columns[8].Visible = false;
}

how to remove a row in kendo grid

can someone help me with this issue in my project..
i have workers that has different logins and have the same role. i have a customer page that worker can apply for a company's position(grid) with different shift(another grid inside the company's position). when a worker apply on that shift,the row will disappear in the grid.
my problem is.. i want to show the row again when another worker logs in.
how can i do this.. i did it only in one worker only.
here's what i have...
controller:
//to load the data of the grid
public JsonResult LoadCustomerPositionShiftWorkerList(int? clientCusPosId, int? clientId)
{
List<userWorkerCompare> workerDetails = new List<userWorkerCompare>();
GlobalVariables.SiteMapFile = "ClientSiteMapProvider";
MembershipUser membershipUser = Membership.GetUser();
string userId = membershipUser.ProviderUserKey.ToString();
var workerIdList = new List<Int32>();
var customerPositionShiftList = new List<Client_Customer_Position_Shift>();
List<ClientCustomerPositionShiftInfo> clientCustomerPositionShiftList = new List<ClientCustomerPositionShiftInfo>();
var filterList = (from a in db.Worker_Customer_Apply_Shift
where a.LogicalDelete == false && a.Client_Customer_PositionID == clientCusPosId
select a).ToList();
//this is to get workerId
if (Roles.IsUserInRole("Worker"))
{
var listWorker = (from a in db.Workers
where a.LogicalDelete == false
select new
{
a.ID,
a.userId,
a.FirstName,
a.LastName,
a.MiddleName,
a.BirthDate,
a.Gender_LookID,
a.LogicalDelete
}).ToList();
if (listWorker.Count() > 0)
{
foreach (var row in listWorker)
{
var cli = new userWorkerCompare
{
ID = row.ID,
FirstName = row.FirstName,
MiddleName = row.MiddleName,
LastName = row.LastName,
LogicalDelete = row.LogicalDelete,
userId = row.userId.ToString()
};
workerDetails.Add(cli);
}
var workerProfile = (from a in workerDetails
join b in db.Workers
on a.ID equals b.ID
where a.LogicalDelete == false && a.userId == userId
select b).SingleOrDefault();
ViewBag.WorkerProfile = workerProfile;
var workerAvail = (from a in db.Worker_Availability
where a.LogicalDelete == false
&& a.Worker_ID == workerProfile.ID
select a).ToList();
ViewBag.WorkerAvail = workerAvail;
var workerId = (from a in workerDetails
where a.LogicalDelete == false && a.userId == userId
select a.ID).SingleOrDefault();
ViewBag.WorkerId = workerId;
//this is to compare customer position shift from worker availability
if (clientCusPosId.HasValue)
{
customerPositionShiftList = (from a in db.Client_Customer_Position_Shift
where a.LogicalDelete == false && a.Client_Customer_PositionID == clientCusPosId
select a).ToList();
foreach (var row in customerPositionShiftList)
{
var workerList = (from a in db.Worker_Availability
where a.LogicalDelete == false && a.Worker_ID == workerProfile.ID
select a).ToList();
foreach (var Availability in workerList)
{
if (Availability.AvailableDay_LookID == row.Day_LookID || Availability.AvailableDay_LookID == 76 || row.Day_LookID == 76)
{
if (((Availability.StartTime == "Anytime" && Availability.EndTime == "Anytime") || (row.StartTime == "Anytime" && row.EndTime == "Anytime")) ||
(row.StartTime == "Anytime" || row.EndTime == "Anytime") || (Availability.StartTime == "Anytime" || Availability.EndTime == "Anytime"))
{
workerIdList.Add(row.ID);
}
else
{
DateTime availStartTime = Convert.ToDateTime(Availability.StartTime);
DateTime posStartTime = Convert.ToDateTime(row.StartTime);
DateTime availEndTime = Convert.ToDateTime(Availability.EndTime);
DateTime posEndTime = Convert.ToDateTime(row.EndTime);
if ((Availability.StartTime == row.StartTime &&
Availability.EndTime == row.EndTime) || (Availability.StartTime == row.StartTime ||
Availability.EndTime == row.EndTime) || (availStartTime < posStartTime && availEndTime > posEndTime))
{
workerIdList.Add(row.ID);
}
}
}
}
}
}
//to show compared list
var toBeList = (from a in customerPositionShiftList
where a.LogicalDelete == false
select a).ToList();
//after applying this one triggers to hide the row
var setToList =
toBeList.Select(x => x.ID).Except(filterList.Select(y => y.clientCusPosShiftId)).ToList();
var cusWorkList = (from a in db.Client_Customer_Position_Shift
where a.LogicalDelete == false
&& workerIdList.Contains(a.ID)
&& setToList.Contains(a.ID)
select new
{
a.ID,
a.Client_CustomerID,
a.Client_Customer_PositionID,
a.Day_LookID,
a.EndTime,
a.StartTime,
a.LogicalDelete
}).ToList();
if (cusWorkList.Count() > 0)
{
foreach (var row in cusWorkList)
{
ClientCustomerPositionShiftInfo ccpsi = new ClientCustomerPositionShiftInfo
{
ID = row.ID,
ClientID = clientId.HasValue ? clientId.Value : 0,
Client_Customer_PositionID = row.Client_Customer_PositionID,
Client_CustomerID = row.Client_CustomerID,
Day = GetLookupDisplayValById(row.Day_LookID),
StartTime = row.StartTime != "Anytime" ? Convert.ToDateTime(row.StartTime).ToString("hh:mm tt") : row.StartTime.Trim(),
EndTime = row.EndTime != "Anytime" ? Convert.ToDateTime(row.EndTime).ToString("hh:mm tt") : row.EndTime.Trim(),
DayID = (row.Day_LookID)
};
clientCustomerPositionShiftList.Add(ccpsi);
}
}
}
}
return Json(clientCustomerPositionShiftList.ToList().OrderBy(p => p.DayID), JsonRequestBehavior.AllowGet);
}
view/script:
<script type="text/javascript">
$(document).ready(function () {
var comparegrid = $("#positionShiftWorkerComparedGrid").kendoGrid({
scrollable: false,
sortable: true,
pageable: true,
dataSource: {
transport: {
read: {
url: '/Customer/LoadCustomerPositionShiftWorkerList?clientCusId=' + clientCusId + '&clientId=' + clientId + '&clientCusPosId=' + clientCusPosId,
dataType: "json",
type: "POST"
}
},
pageSize: 10
},
rowTemplate: kendo.template($("#positionShiftWorkerComparedTemplate").html().replace('k-alt', '')),
altRowTemplate: kendo.template($("#positionShiftWorkerComparedTemplate").html())
});
});
</script>
thanks!

Resources