Prepopulate SearchBox

Prepopulate SearchBox

MOR_HOMSMOR_HOMS Posts: 3Questions: 1Answers: 0
edited June 2016 in Free community support

When i run a query and i get back the results, i have hyperlinks on one column. When i click one of the hyperlinks i can get the table row data and put the required data into variables. When the hyperlink is clicked it goes off and runs a query and brings back a partial view with the data table's displaying the results. What i want is when the datatable comes back that the search bar is prepopulted with the variables with the required data. When i do this

"search": {
            "search": ('dunnes' + " " + '14/06/2016')
        } 

I get exactly what i want. What i want to do is somthing like this

"search": {
            "search": ('customername' + " " + 'date')
        }

I have looked at the documentaion but can't see how this would be done. Is this possible to do? I am using MVC

Answers

  • MOR_HOMSMOR_HOMS Posts: 3Questions: 1Answers: 0

    I solved it i am doing this

    "oSearch": { 
                "sSearch": (@Html.Raw(Json.Encode(@ViewBag.CustomerID))) + " " +   (@Html.Raw(Json.Encode(@ViewBag.Date)))}
        });
    

    Which does exactly what i want

This discussion has been closed.