I am new to working in the DSO.JS, CrossFilter.JS bootstrap and generating table contents. I would like to get the data as if searching in the DataBable using the following bootstrap in the following with some pnnation.
In that example the table is statically defined with id and orbit. Like the source code of the example page I am able to run the html page with the desired output.
But in my case I am creating a table from the function and the table is not able to get paging and search box at the top. I have added all supported files like JS and CSS files
This is my code and I reduce the code to avoid more space in this portal. I know where I'm making a mistake.
& lt; Html & gt; & Lt; Top & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = us-ascii" & gt; & Lt; Meta name = "viewport" content = "width = device-width, initial-scale = 1" & gt; & Lt; Title & gt; Databatab Example - Bootstrap & lt; / Title & gt; & Lt; Link rel = "shortcut icon" type = "image / png" href = "/ media / images / favicon.png" & gt; & Lt; Link rel = "stylesheet" type = "text / css" href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" /> & Lt; Link rel = "stylesheet" type = "text / css" href = "https://cdn.datatables.net/plug-ins/380cb78f450/integration/bootstrap/3/dataTables.bootstrap.css" /> & Lt; Script src = "https://code.jquery.com/jquery-1.11.1.min.js" & gt; & Lt; / Script & gt; & Lt; Script src = "https://cdn.datatables.net/1.10.3/js/jquery.dataTables.min.js" & gt; & Lt; / Script & gt; & Lt; Script src = "https://cdn.datatables.net/plug-ins/380cb78f450/integration/bootstrap/3/dataTables.bootstrap.js" & gt; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Script type = "text / javascript" src = "http://cdnjs.cloudflare.com/ajax/libs/d3/2.10.0/d3.v2.min.js" & gt; & Lt; / Script & gt; & Lt; Script type = 'text / javascript' src = "crossfilter.js" & gt; & Lt; / Script & gt; & Lt; Div id = "default" class = "default" & gt; & Lt; / Div & gt; & Lt; Script & gt; $ (Document) .ready (function () {$ ('# example'). DataTable (); $ ('# default'). Show ();}); D3.json ("myJson.json", function (desing) {var data = desing; var ndx = crossfilter (data); var state1 = ndx.dimension (function (d) {return d.region;}) var dist1 = Ndx.dimension (function (d) {return d.cluster;}); var taluk 1 = ndx.dimension (function (d) {return d.center;}); var village 1 = ndx.dimension (function (d) {Return d.loan_type_id;}); cfds = ndx.dimension (function (d) {return d.region;}); $ ("# default"). Html (total (cfds.top (infinite)); cfds FilterAll ();}); Workspace (jsn) {var html = ""; Html + = "& lt; thead & gt;" Html + = "& lt; tr & gt;" Html + = "<"> Field Html + = "& lt; th & gt; CLUSTER & lt; / th & gt;" Html + = "& lt; th> center Html + = "& lt; th & gt; GLP Month & lt; / th & gt;" HTML + = "& lt; th & gt; Debt AMT Dusbberg & lt; / th & gt;" Html + = "& lt; th & gt; New Members & lt; / th & gt;" Html + = "& lt; th & gt; Demand Html + = "& lt; th & gt; Principal & lt; / th & gt;" Html + = "& lt; th & gt; INTEREST & lt; / th & gt;" Html + = "& lt; th & gt; written off & lt; / th & gt;" Html + = "& lt; th & gt; Hm-Processed & lt; / th & gt;" Html + = "& lt; th> Hm-Validate & lt; / th & gt;" Html + = "& lt; th> Qualified% Html + = "& lt; th & gt; Credit Type & lt; / th & gt;" Html + = "& lt; / tr & gt;" Html + = "& lt; / thead & gt;" Json.for every (function (line) {html} = "& lt; tr role = 'row' '; (for the key in the line) {html + =" & lt; td> "+ row [Key] + "& lt; / td>";}; html + = "";}); Returned "and lieutenant; table id = 'example' class = 'table table-stripe table-range' cell field = '0' width = '100%' role = 'grid' aria-describedby = 'example_info' & gt; + html + "& Lt; / Table> ";} & lt; / script> & lt; / body & gt; & lt; / html & gt;
After completing supported JS files it is working body tag. Also I started the data under D3 function. Now everything is fine.
& lt; script type = "text / javascript" src = "http://code.jquery.com/jquery-1.11.1.min.js" & gt; & lt; / script & Gt; & lt; script type = "text / javascript" src = "http://cdn.datatables.net/1.10.3/js/jquery.dataTables.min.js" & gt; & lt; / script & Gt; & lt; / body & gt; & lt; / html & gt;
Its use for anyone Mr. Hope ..
Comments
Post a Comment