From 812aeaea764cfddc3413892b74cb9eba4e9f1229 Mon Sep 17 00:00:00 2001 From: martimarkov Date: Wed, 26 Aug 2015 19:53:49 +0100 Subject: [PATCH] Add option to use custom DOM --- Mvc.JQuery.Datatables/DataTableConfigVm.cs | 27 +++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/Mvc.JQuery.Datatables/DataTableConfigVm.cs b/Mvc.JQuery.Datatables/DataTableConfigVm.cs index 0384a25..aaeaf2c 100644 --- a/Mvc.JQuery.Datatables/DataTableConfigVm.cs +++ b/Mvc.JQuery.Datatables/DataTableConfigVm.cs @@ -79,17 +79,28 @@ public JToken SearchCols + private string _dom; + public string Dom { - get { - var sdom = ""; - if (ColVis) sdom += "C"; - if (TableTools) sdom += "T<\"clear\">"; - if (ShowPageSizes) sdom += "l"; - if (ShowSearch) sdom += "f"; - sdom += "tipr"; - return sdom; + get + { + if (!string.IsNullOrEmpty(_dom)) + return _dom; + + string str = ""; + if (this.ColVis) + str += "C"; + if (this.TableTools) + str += "T<\"clear\">"; + if (this.ShowPageSizes) + str += "l"; + if (this.ShowSearch) + str += "f"; + return str + "tipr"; } + + set { _dom = value; } } public bool ColVis { get; set; }