Skip to content
Advertisement

Ajax POST data not appearing in modal

I have a table that’s populated by JSON data. In the last column you can open up a modal that corresponds to each row and you can add a comment in an input box—doing so will update that modal. In other words, table rows that have no comments have an empty modal and rows with at least one comment should appear in the modal that they correspond with.

In my backend manager (SQL Server Management Studio) I can see that the comments are showing up there, but they’re not appearing in the modals.

I can’t tell if the problem is coming from the JavaScript side (the view) or from the model, or from elsewhere.

The addition of the DocBudgetId is relatively new. Before that, the review/comment data was tied to the DocNumber and the info was appearing in the modals. I suspect that I have to make an adjustment/change to the DocBudgetId but I’m not sure how.

Modal screenshot: https://i.stack.imgur.com/Vqd4o.png The DocNumber appears on the top left. Comments have been made to the row that this modal belongs to but they’re not appearing in the modal table.

Model:

View:

Controller

Sql file

Advertisement

Answer

Update: I did some tinkering and got the table data to show.

In the stored procedure (GetDocUnderReviewDetails.cs) I commented out the line where DocBudgetId = @DocBudgetId and added where DocNumber = @DocNumber. I noticed that if I just commented out where DBI = then it showed all of the comments made for every modal, which was an issue I was dealing with earlier.

So now, my stored procedure looks like this:

I also added string docNumber to the Controller:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement