cancel
Showing results for 
Search instead for 
Did you mean: 

refresh grid/problem with search

Former Member
0 Kudos

hello, i have a grid and i want to make a search per date and then refresh the grid to came back to the initial values...

when i load my page it is like this: http://img9.imageshack.us/img9/6359/gridy.jpg

the values that the grid shows have the actual date

the user can put some date in that textbox and then i press the button "search", i build an function but it show me this error: "document.SearchData is null or not an object" but curious after some seconds update the grid with the corresponding search values.

with the "Refresh" button i want to the grid came to the values when the pages load...i build another function and put this

document.grd_ScrapList.updateGrid(true);

but dont work..dont know why

could someone help me

regards and thanks in advance

Mário

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Mario,

Clicking Search should set the date which the user has entered in the query and re-read the data. Refresh should set the current date in the query and reread the data.

The function updateGrid(true) rereads the query using the actual query parameters. If you want to refresh the data to the current date, you may try the refresh function. Have a look at the MII help: [iGrid Methods|http://help.sap.com/saphelp_xmii120/helpdata/en/44/cf1aa93afb6f1ee10000000a155369/frameset.htm].

What does you document.DearchData look like?

Hope this helps.

Michael

Former Member
0 Kudos

hello i tried to refreh the page like this

document.grd_ScrapList.refresh

and this

document.grd_ScrapList.getGridObject.refresh

but didnt work.

regards

Mário

Former Member
0 Kudos

Mario,

have you tried it using brackets "...refresh()" like described in the MII help I have linked above ?

Michael

Former Member
0 Kudos

yes i did like this:

document.grd_ScrapList.refresh();

and this

document.grd_ScrapList.getGridObject().refresh()

in the first the scroll bar blinks...like when it is an Update

in the second appears the error "Unspecified error"

regards

Mário

Former Member
0 Kudos

Mario,

as the refresh() is a grid function, your first code is correct. But I have just tried an example and see what you mean. The refresh() just rereads the query with the settings I had set before. So I would think you have to add some code in your JS refresh function that resets the starttime to the current time to get the result you want (show the result using the actual date).

Michael

Former Member
0 Kudos

thanks a lot for your help...i was doing a stupid thing again

with your help i putted the Refresh and the Search working...the code is it was the same only the date different .

thanks a lot

Mário