can i used iTotalRecords in render function?

can i used iTotalRecords in render function?

KimJuHwanKimJuHwan Posts: 8Questions: 2Answers: 0
edited February 2019 in Free community support

Controller

map.put("data", list);
map.put("iTotalRecords", totCnt);
map.put("iTotalDisplayRecords", totCnt);
ModelAndView modelNView = new ModelAndView(ajaxMainView,map);
return modelNView;

script

columns:[
        {'data':'rnum',
            render:function(data,type,row){
                return data
            }   
        }
]

I want to use iTotalRecords in render function...

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @KimJuHwan ,

    Yep, you can get the last returned JSON with ajax.json(). Alternatively, you could call page.info() which also has this information, plus other properties about the table.

    Cheers,

    Colin

  • KimJuHwanKimJuHwan Posts: 8Questions: 2Answers: 0
    edited February 2019

    can i use ajax.json() in render function ??

    but ...

    ,{'data':'name',
                render:function(data,type,row){
                    if('QNA'=='QNA'){
                        return ajax.json() <---- error : Uncaught ReferenceError: ajax is not defined 
                    }else{
                        return 'admin'
                    }
                    
                }
            }
    
  • KimJuHwanKimJuHwan Posts: 8Questions: 2Answers: 0

    oh!! thank you.
    Resolved.

This discussion has been closed.