0

I am having checkbox in column header and onclick sending event argument as checkbox and name of column where checkbox is belong to:

"aoColumns": [
{ 'mData': '@ModelName.ColumnDateTime',
  'sName': '@ModelName.ColumnDateTime',
  'sTitle': '<input type="checkbox" onclick="handleClick(this, @ModelName.ColumnDateTime)" id="checkbox1"></input> DateTimeColumn',},
{ 'mData': '@ModelName.ColumnSource', 'sTitle': '@ModelName.ColumnSource <input type="checkbox"></input>', 'bSortable': false }],

function handleClick(cb, sName) 
{
    alert("Clicked, new value = " + cb.checked + sName);
}

I am getting error for @ModelName.ColumnDateTime for handleClick(this, @ModelName.ColumnDateTime), value for @ModelName.ColumnDateTime is DateTime.

1 Answer 1

1

quote your string

onclick="handleClick(this, \'@ModelName.ColumnDateTime\')"
Sign up to request clarification or add additional context in comments.

2 Comments

Error Expected }
sorry bro, I am beginner in jquery!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.