CXM_jquery_datatable_server_side.anubis 1.08 KB
/*
 * Created by PyramIDE.
 * User: Totoro
 * Date: 03/05/2014
 * Time: 17:46
 *
 */

read calexium_lib/web/jQuery/CXM_jquery_datatable_types.anubis
read tools/basis.anubis
read calexium_lib/web/CXM_common.anubis
read calexium_lib/web/CXM_web_arg_utils.anubis

public define Maybe(JQuery_datatable_server_side_type)
  get_datatable_server_side_query
  (
    List(Web_arg) lwa
  )=
  
  if get_String(lwa, "sEcho") is {failure then failure, success(secho) then
  if get_Int(lwa, "iColumns") is {failure then failure, success(icolumns) then
  if get_String(lwa, "sColumns") is {failure then failure, success(scolumns) then
  if get_Int(lwa, "iDisplayStart") is {failure then failure, success(idisplaystart) then
  if get_Int(lwa, "iDisplayLength") is {failure then failure, success(idisplaylength) then
  if get_String(lwa, "sSearch") is {failure then failure, success(sSearch) then
//  if get_String(lwa, "sSortDir") is {failure then failure, success(sSortDir) then
    success(dt_ss(secho, icolumns, scolumns, idisplaystart, idisplaylength, if sSearch = "" then failure else success(sSearch)))
  }}}}}}.