When trying to run an if statement with Javascript on a Jexcel to look at Cell 1,1 it seems to remove all the cells and leaves just one cell with a number 1 in it. I am new to Javascript so it is quite possible I am just not understanding it well enough, so dont be surprised if I have got the code completely wrong as my background is VBA. However if someone could just guide me on how to get it to look in one cell I am sure I can write the rest.
I have been trying to get the on-line guides on Jexcel to try understand it but I am not getting what I am missing. I have tried to follow the guide on the following https://www.teamdev.com/downloads/jexcel/docs/JExcel-PGuide.html
but I am not getting exactly what I want it to do, which is look at the cell and follow a process depending if it is empty or not. It doesn't debug so I am not sure what else to try.
<script>
function findIt() {
var r = confirm("This will find all data, do you wish to
proceed?");
if (r == true) {
$('#FRSTable').jexcel(data,{
table: function (instance, cell, col, row, val, id) {
cell = worksheet.getcell(1,1);
if (cell() == null)
{
alert("Please Enter a Value");
}
}
});
} else {
alert ( "You pressed Cancel!");
}
}
</script>
So what I expect is for it to say Please enter a value, what happens is all the Cells get removed and a single box with a number 1 replaces it, this resets after reloading the page.
The guide you are looking for actually is here. But, actually, jExcel brings a native searchable option.
The example above can be found at: https://bossanova.uk/jexcel/v3/examples/datatables