I'm rather new to web development so I'm using MVC with ASP.NET and I've got an hard time with jQuery and its functions. I'm using the Razor View Engine with ASP.NET MVC c# with devexpress controls if that helps.
Now this is my problem:
I got a View which has an @Html.Action('view','controller'); declared which links to a gridview.
On that gridview I got some clientside functions that presents a detail View when a row is selected and Enter is pressed on the keyboard.
Now the gridview I'm using has some automated search options by clicking in a textfield and typing in what you want to look for and press enter. I declared a value which holds a value if I'm searching or selecting a row and press enter.
So after that I got it to work that when I press enter in the search textfield it wont open the Detail View. But it performs a callback when searching. In which the gridview is newly created. Now I got the problem that my function doesn't find the element anymore after this callback on the GridView.
I tried using the .find function in jquery but that didn't help. Here are some snippets I tried:
(these are located in a $(document).ready function)
$('#id').click(function () {
// do something
});
And the .find version:
$('#gridview').find('#id').click(function () {
// do something
});
So basically I want to be able to find the element AFTER the gridview has been build again.
::EDIT:: The ID's on the textfields.click stay the same.
::EDIT2:: I've found a cheap and dirty solution by adding my current code inside the EndCallback clientsideevent of the devexpress gridview. But there must be a decent way to do this... But this also proves my previous edit, where the id's stay the same.