Search
18504 results 2891-2900
Forum
- 1st Jul 2016datatables ajax parameters while initilize first timei m using codeigniter here i pass the values from form for example here i am passing date value to model and and get back the corresponding data record to view . please give me solution how can i post parameter ?
- 29th Jun 2016Can the example "Child rows..." handle just a table instead "ajax"I've been pondering for the past day about the example Child rows (show extra / detailed information). Is it possible to use DataTables to use something like below for the Child Rows (see code snip below with table id of "dataTable" - yeah, bad name)? The sample is actual development data that is history of all, we would like the latest history to be displayed, then when the user click the "+", it would expand to show all the history. For example, this is the output currently: R 3WC9GGV Oct 15 2015 FOX SWIPER Jul 01 2016 Jul 02 2016 SelectSpot R 3WC9GGV Oct 15 2015 FOX SWIPER Jul 01 2016 Jul 02 2016 SelectSpot A 3WC9GGV Oct 19 2015 FOX SWIPER Jul 01 2016 Jul 02 2016 SelectSpot R 3WC9HFW Oct 15 2015 FOX SWIPER Jul 02 2016 Jul 03 2016 SelectSpot R 3WC9HFW Oct 15 2015 FOX SWIPER Jul 02 2016 Jul 03 2016 SelectSpot R 3WC9HFW Oct 15 2015 FOX SWIPER Jul 02 2016 Jul 03 2016 SelectSpot I'd like this to display this way without expansion: + A 3WC9GGV Oct 19 2015 FOX SWIPER Jul 01 2016 Jul 02 2016 SelectSpot + R 3WC9HFW Oct 15 2015 FOX SWIPER Jul 02 2016 Jul 03 2016 SelectSpot This is what it would be with expanded: - A 3WC9GGV Oct 19 2015 FOX SWIPER Jul 01 2016 Jul 02 2016 SelectSpot R 3WC9GGV Oct 15 2015 FOX SWIPER Jul 01 2016 Jul 02 2016 SelectSpot R 3WC9GGV Oct 15 2015 FOX SWIPER Jul 01 2016 Jul 02 2016 SelectSpot + R 3WC9HFW Oct 15 2015 FOX SWIPER Jul 02 2016 Jul 03 2016 SelectSpot Here is the JSP that is working - names have been changed to protect the innocent. <%@ include file="/common/taglibsref.jspf" %> <script type="text/javascript" src="<c:url value="/js/jquery-1.12.2.min.js"/>"></script> <script type="text/javascript" src="<c:url value="/js/jquery.dataTables.min.js"/>"></script> <script> jQuery(document).ready(function() { var objectArr = []; jQuery('.dataRow').each(function() { var tdArr = this.getElementsByTagName("td"); var message = { status:tdArr[0].innerHTML, histno:tdArr[1].innerHTML, datemade:tdArr[2].innerHTML, lastname:tdArr[3].innerHTML, firstname:tdArr[4].innerHTML, adate:tdArr[5].innerHTML, ddate:tdArr[6].innerHTML, processed:tdArr[7].innerHTML, select:tdArr[8].innerHTML }; objectArr.push(message); }); jQuery('#messageRows').DataTable( { data: objectArr, "iDisplayLength": 15, "aLengthMenu": [[15, 25, 50, 100,-1], [15, 25, 50, 100, "All"]], "columns": [ { "mData": "status" }, { "mData": "histno" }, { "mData": "datemade" }, { "mData": "lastname" }, { "mData": "firstname" }, { "mData": "adate" }, { "mData": "ddate" }, { "mData": "processed" }, { "mData": "select"} ], "order": [[ 1, "asc" ], [2,"asc"]], }); }); </script> <div class="crumbs"> <span class="leftcrumbs"> <html:link action="/searchForm" name="searchForm" property="allParams">History</html:link> > <span class="current">Search Results</span> </span> </div> <div class="search"> <table cellspacing="0" cellpadding="0"> <c:if test="${empty searchForm.searchResults}"> <tr><td><span class="errors">No history have been found for the specified search criteria.<br><br></span></td></tr> </c:if> </table> </div> <table id="messageRows" class="display compact" cellspacing="0" width="100%"> <thead> <tr> <th>Status</th> <th>History</th> <th>Date Made</th> <th>Last Name</th> <th>First Name</th> <th>A Date</th> <th>D Date</th> <th>Processed</th> <th>Select</th> </tr> </thead> <tfoot> <tr> <th>Status</th> <th>Histoyr</th> <th>Date Made</th> <th>Last Name</th> <th>First Name</th> <th>A Date</th> <th>D Date</th> <th>Processed</th> <th>Select</th> </tr> </tfoot> </table> <table id="dataTable" style="display: none;"> <c:forEach var="combo" items="${searchForm.searchResults}"> <tr class="dataRow"> <td><c:out value="${history.status}"/></td> <td><c:out value="${history.history}"/></td> <td><fmt:formatDate pattern="MMM dd yyyy" value="${history.dateMade.date}"/></td> <td><c:out value="${history.guest.lastName}"/></td> <td><c:out value="${history.guest.firstName}"/></td> <td><fmt:formatDate pattern="MMM dd yyyy" value="${history.dateSpan.beginDate}"/></td> <td><fmt:formatDate pattern="MMM dd yyyy" value="${history.dateSpan.exclusiveEndDate}"/></td> <td><c:out value="${history.processedFlag}"/></td> <td>SelectSpot</td> </tr> </c:forEach> </table>
- 17th May 2016Row highlight based on data coming from ajax loadI have seen this for active selecting, https://datatables.net/examples/api/select_single_row.html but what about highlighting a row based on data in the dataset used to fill the table?
- 16th May 2016Editor not closing and can't be re-opend upon successfull ajax edit/addAs per the subject, when I add or edit the datatable everything works fine until the response comes back from the server (data was properly updated on the backed). At this time, neither the 'Add' nor 'Edit' modals disappear. Also at this time, I am no longer able to pull up the add/edit/delete modals. It's as if the DataTables plugin gets stuck in a certain state. Deleting multiple times works fine. Summary: - page loads, datatable populates with expected data - delete a user, works fine - delete another user, works fine - add/edit a user, user info saved to backend but modal doesn't close. no errors reported - clicking add/edit/delete no longer does anything My guess is that there is a problem with the returned JSON but I've inspected it using Chrome and this is my returned JSON: {"data":[{"DT_RowId":"row_8","id":"user-be469311-17c2-4991-9a01-fbf11953644f","name":"zzz user","email":"test@test2.com","phone":"5555555555","password":"","companyId":"aeryon-labs","eula":false,"disabled":false,"pilot":false,"group":"","company":""}]} This JSON appears to meet the requirements for what is expected in the response. Is there any other known reasons for the editor interface to operate this way? In case it's relevant, here's the code I used for the edit button: edit: { type: 'PUT', url: "/api/admin/user", data: function(row) { var user = row["data"]; var userInfo; var userId; // extract the user information from the row -- this may change when the returned data set is changed for (var key in user) { if(user.hasOwnProperty(key)) { userId = key; userInfo = user[key]; break; } } var name = userInfo["name"]; var email = userInfo["email"]; var phone = userInfo["phone"]; var companyId = userInfo["companyId"]; var company = userInfo["company"]; var group = userInfo["group"]; var pilot = userInfo["pilot"]; var disabled = userInfo["disabled"]; var userInfoJSON = {"id":userId, "submitType": "edit", "name":name, "email":email, "phone":phone, "companyId":companyId, "company":company, "group":group, "pilot":pilot, "disabled": disabled } return JSON.stringify(userInfoJSON); }, dataType: "json", contentType: "application/json", processData: true, cache: false, success: function(data) { table.ajax.reload(); //editor.close(); }, error: function() { //should be able to handle errors if we return the proper json object from the server -- requires errors[] } I tried to setup a test for demo purposes (actual site isn't available publicly) but we are using React and I wasn't able to get a valid test going. I've added as much code as possible to give an idea of what I'm doing. Hopefully this will be enough.
- 14th May 2016AJAX Add $get["columns"]["search"]["value"] on a non existing columnIs there a way to add a $get["columns"]["search"]["value"] on a non existing column ? I mean : I want to search in my DB on a field that is not rendered in my dataTable and I don't know how to handle it.
- 3rd May 2016How to span a dynamic Ajax column header to two columns?I'm creating Datatable column header dynamically. However, I need two header rows in the table. First header row needs to display "Information" spanning 2 columns and second header row is as below. Is it possible to achive this? var tableHeaderJson = {"columns": [{"title": "Host Group"}, {"title": "Flavor"}]}
- 27th Apr 2016Individual column searching with ajax loadNot working for me plz help
- 6th Apr 2016How can I implement dataTable ajax load with checkbox filters?I have a lot of checkbox grouped. For example group cities depends on cities table from db, streets depends on street and so . For example the cities group code: <div class="form-group"> <div class="button-group"> <button type="button" class="btn btn-default btn-sm btn-block dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> Streets <span class="caret pull-right"></span> </button> <ul class="dropdown-menu"> @foreach($streets as $street) <li> <input type="checkbox" class="minimal" id="area-{{ $street->slug }}"> <label for="area-{{ $street->slug }}">{{ $street->name }}</label> </li> @endforeach </ul> </div> </div> And the result: https://i.imgur.com/C2vGt02.png So how can I collect all the filters and join the tables in backend to return the proper results? Also some of the filters are not in the table because the table would be too long. Thank you.
- 4th Mar 2016Bootstrap Popover not working in DataTables with Ajax returned dataI was planning to implement bootstrap popover for DataTables but it is not working as it should be. Sometimes I see popovers on page 1 and not on others. It is not consistent. If I use ajax.load function it is not at all working. Code below: { "bSortable": false, "data": "empId", "render" : function(data,type, full, meta) { //Popover $('.hoverclass').popover().hover(function(e) { e.preventDefault(); }); //estimateId = data; return ''; } Help is appreciated, thanks :)
- 12th Feb 2016using fnserverdata with datatable 1.10 calling multiple ajax requestsplease sggesst