Welcome Guest, Not a member yet? Register   Sign In
AJAX reloading problem
#1

[eluser]Juzt1s[/eluser]
Hello,

so the situation I am having problems with is that I have table, I use ajax to update fields. So far so good, but I have a column which counts the value based on two other columns.
example: COLUMN A value 2, COLUMN B value 2, so the COLUMN c has the value of 4.

I use this one:
Code:
echo $row->wValue * $row->rValue;
On page load, I query all the stuff I need. (in controller)

But the problem is, that I must reload ENTIRE page to get the new value if I've change either COLUMN A or B.

Is there any way of doing this without reloading entire page?

Thank you in advance.
#2

[eluser]Techno Heart[/eluser]
You can update it using Jquery
#3

[eluser]Juzt1s[/eluser]
I know, I tried to update the column itself, however it does not work, because when I load that view I put in query everything I need. And my counting column uses those values. Maybe I should take any other approach?
#4

[eluser]Techno Heart[/eluser]
I don't know exactly what you are trying to do. I'll explain what i understood tell me if am wrong.

You have a column called A and B
You click on update the values are updated in DB and you want the new values of A*B in col C right.

Instead of using php form submit user jquery ajax post to update , after updating in DB echo the product of A and B in controller and you will get that value in Jquery so update the columns with their form id's (i.e)
Code:
$('#A').val(1);
$('#B').val(2);
$('#C').val(3);
Am i correct or you requirement is different?




Theme © iAndrew 2016 - Forum software by © MyBB