Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I been trying from couple of days to bind my view part with controller in razor style and i done to a level well everything working cool but i'm stuck now & any clue is appreciated .

My mvc controller returns something like
C#
public ActionResult Listings(string id)
{
// my code to build list
return View(//My List);
}



In cshtml :
HTML
@foreach(WebApp.Models.PersonModel item in Model)
          {
          <tr>
              <td>@item .ContactPerson</td>
         </tr>
            }

I am loading/sorting even exporting also fine with wonderful tabletools but not as expected .

Problem : When i mention a search criteria like name say 'jeff' i get contatcperson names with jeff and i try to export to pdf/excel but i get all records which are loaded into datatable exported not filtered ones? is this a bug with DT or any thing i need to correct from my end ?

PS : i have done filter based export when i am using sAajxSource etc with controller returning JSON but now its not the case you can clearly understand

Thank you
Posted
Updated 15-Sep-14 18:57pm
v2

1 solution

CSS
yeah i got it done small option oSelectorOpts set in my js file under tabletools

"oTableTools": {
"aButtons": [
    {
        "sExtends": "Excel",
        "sButtonText": "Excel",
        "oSelectorOpts": {
            page: 'current'
        }
    }
]
}

Reference : http://datatables.net/extensions/tabletools/button_options#oSelectorOpts
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900