How to make pagination input read only?
How to make pagination input read only?
yousufsadat
Posts: 25Questions: 11Answers: 0
Hello. I am using pagingType as input to see the page number inside the box but I don't want the user to change the page number to go to the desired page. is there a way to make this property read only. Just show the page number inside the box without the ability to change it. This is how my JQuery looks like so far.
var table = $('#esignTable').DataTable({"sDom": '<"top"flp>rt<"bottom"i><"clear">',
pagingType: 'input',
pageLength: 5,
language: {
"sEmptyTable": " ",
oPaginate: {
"sNext": '<img src="../images/integration/SlowRight.jpg">',
"sPrevious": '<img src="../images/integration/SlowLeft.jpg">',
"sFirst": '<img src="../images/integration/FastLeft.jpg">',
"sLast": '<img src="../images/integration/FastRight.jpg">',
}
}
});
This discussion has been closed.
Answers
I am trying to get the highlighted part read only. Thanks
The whole point of the pagination "input" extension is to enable the user to type in a page number. Why would you install an extension and then try to cancel its whole purpose?
And if you do want that, just modify the extension a little. Add
disabled
to theinput
element.Allan
Tangerine. I know what you are saying but this is the requirement, no one wants to make life harder.
Allan: would i be like this
Alright guys, i got it. I did using JQuery. Thanks all.
Line 77 of this plug-in - adding
nInput.disabled = true;
would be all that is needed.Allan
Hi Allan. I am using CDN so I don't know how would it work in that case. But I got it using plain JQuery. I get the class and using attr method setting it to true.