On-insert

QuestionsOn-insert
germanmary asked 10 years ago

Hi abu,

I have a small issue and doubts,

I have two tables

table1 and table2

i have done the grids. in table2 page i have used the dropdown call back method

it works fine

i would like to updated the status in the first table based on the status selected in the second page.

i have tried with custom event but it is not getting updated.

can you guide me how to do it?

Thanks

7 Answers
Abu Ghufran answered 10 years ago

In the on_update event of second grid page, you can execute a sql command that update the first table.

germanmary answered 10 years ago

yes i have tried that also

but it is not updated

i will paste my code in pastebin

please tell me the problem where it occurs

Abu Ghufran answered 10 years ago

Please share pastebin link. Missing in last message.

Abu Ghufran answered 10 years ago

Code looks fine, please add some debugging lines in callback to check the issue.

function update_by($data)
{

ob_start();
print_r($data);
$arr = ( ob_get_clean() );

$str = "UPDATE invopo_quotationmaster SET status='ordered'
WHERE quotationid = {$data["quotationid"]}";
mysql_query($str);

echo $arr;
phpgrid_error($str);

}

germanmary answered 10 years ago

no message is shown

Abu Ghufran answered 10 years ago

Try following steps.

1) Open grid in firefox
2) Press F12, firebug mode.
3) Do an update on grid
4) Check firebug POST ajax call of update
5) Check the ajax Response tab of that call.

What ever you echo in that function should be printed along in ajax response tab.

Your Answer

6 + 3 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?