- Screen name: pavilionwi
pavilionwi's Profile
48 Posts
157 Responses
0
Followers
Show:
- Expanded view
- List view
Private Message
- 24-Aug-2014 11:47 AM
- Forum: Using jQuery Plugins
Hello Everyone:
This question is hard to conceptualize, so please bear with me. Does anyone know of a jQuery table plugin that will allow dynamic blocking of data? Specifically the table needs to be able to block data as follows:
- One block for every work station
- Within each work
station block by group assignments - will need to color code
each work group
- Force table to start a new column of data for every 4th work station
- Allow users to designate number of work stations
- Allow users to name and designate number of work groups within
individual work stations.
If anyone knows of a jQuery plugin that can accomoditate this type of data grouping, I'd really appreciate a heads up.
Thanks Much:
Michelle
- Hello Everyone:
I hope this question is in the right forum. I'm using jQuery fullCalendar and having trouble with asynchronous execution preventing a proper refetchEvents. In research I found out about jQuery.deferred, but can't seem to properly execute a refetchEvents AFTER posting new events to the php file. Following is my script as it now stands:- // Now that you've grabbed returned data from ol_LogEdits.php and created arrays, send the new arrays to ol_postActivity.php for INSERTing
- $.post("ol_postActivity2.php",{activityAry:extendArry, participantArry:extendParticipants},function(data){
- })
- .done(function (response) {
- //Our JSON response will come back with an http status of 200,
- // so we have to handle our errors in the "done" (success)
- // callback of the promise returned by post().
- if (response.error) {
- console.log("An error occurred");
- } else {
- $('#calendar').fullCalendar( 'refetchEvents' );
- console.log("Success!");
- }
- })
- .fail(function (response) {
- //This gets executed on failing http status codes (e.g. 400)
- console.log("A server error occured (failing http status code)");
- });
The console log is reporting "Success" from line 12. And I can see the calendar refresh, but the newly added events are not showing up on the calendar.
What am I doing wrong, the new data is INSERTING into the appropriate table, it's just that the calendar is not refetching it. I can only assume that it is because of asynchronous execution. So... why isn't the deferred taking care of the issue?
Thanks in Advance - Pavilion
- 06-Nov-2013 07:59 PM
- Forum: Using jQuery Plugins
Hello:
I'm running jQuery datetimepicker with fullCalendar. For the most part things are working well. Specific to this situation, I built it so that after user's ..- Selects a date on the Calendar
- The date (or dates if user selects multiple dates on the calendar) are then dumped into #startDate and #endDate input controls.
- There are other input fields that user's enter data in to start the new activity, then a submit button pushes the dates and other values into an array for processing.
- $("#startDate").datetimepicker({
- onClose: function(dateText, inst) {
- // Get start dateTime and add 15 minutes for end dateTime
- start_TimeStamp = new Date(dateText);
- end_TimeStamp = new Date(start_TimeStamp.setMinutes(start_TimeStamp.getMinutes() + 15));
- setTimeout(function() {
- // Need to set timeout to grab correct end_TimeStamp after StartDate was populated.
- // Before setTimeout() was inserted the end_TimeStamp variable was not grabbing the right time.
- }, 500);
- endDateTextBox.datetimepicker('setDate', end_TimeStamp);
- endDateTextBox.datetimepicker('option', 'minDate', startDateTextBox.datetimepicker('getDate') );
- },
- onSelect: function (selectedDateTime){
- // restrict choices in endDateTextBox by what is chosen in startDateTextBox
- endDateTextBox.datetimepicker('option', 'minDate', startDateTextBox.datetimepicker('getDate') );
- },
- showSecond: false,
- timeFormat: 'hh:mm TT',
- minuteGrid: 15,
- stepHour: 1,
- hourMin: 0,
- hourMax: 24,
- separator: ' @ ',
- showTimezone: false
- });
I can't clear out either the onClose or the onSelect options after submitting and saving an event.
Does anyone know how to clear datetimepicker options?
Thanks in advance - Pavilion
- Hello:
Help is needed with jQuery.parseJSON(). Following is a sample of the json_encode() array returned from a php file.
As you can see:{"startTM":"09-10-13 | 08:30 AM","endTM":"09-06-13 | 08:30 AM","Owner":"Duck, Donald","ActivityID":"550"}- There are double " around all associative keys and values.
- Both the startTM and endTM values include an |
- The Owner value includes a ,
So ... in jQuery when I use the following syntax:
- rowContent_Arry = $(this).val();
console.log("dump content array: " + jQuery.parseJSON(rowContent_Arry));
I'm getting the following error message:
So... what needs to be done in order to properly parse the returning json_encode() array?SyntaxError: JSON.parse: unterminated stringThanks in Advance:
Pavilion
- Hello:
I'm adding some column filters to a table. The column filters with <selects are working great because there is an apples-to-apples match.
However, one of my column filters needs to work with a wildcard, and I'm running into problems. Following is the applicable script:- $(document).on('keypress','#filterSubject',function(e) {
- if(e.which == 13) { // runs on ENTER key
- // Extract user entered filter val()
- var filterSubject = $(this).val();
- // run an .each function on the td class 'toggleSubject'. This forces the filter to only act on the Subject column
- $("td.toggleSubject").each(function () {
- var TD_txt = $(this).html();
- // now compare user entered filter val() against inspected .html(). If there is NOT a match, then hide parent <tr
- if (TD_txt *= filterSubject) // stops working here
- {
- console.log("contains string: " + TD_txt);
- // $(this).parent('tr').show();
- }
- else
- {
- console.log("Does NOT contain string: " + TD_txt);
- // $(this).parent('tr').hide();
- }
- });
- } // End if
- });
Since the subject column needs to be searched via a wildcard, I did a bit of research and found *= as the jQuery wildcard operator. But it's not working with my if() function. The script stops working at the following line:
- if (TD_txt *= filterSubject) // stops working here
- {
Does anyone have any idea why? Am I using the correct wildcard operator?
Thanks in Advance - Pavilion
- Hello Everyone:
I've got a couple of questions about setInterval(). Following is my setInterval script:- var varFilter = '';
- // ############ Manage autoreload of table data ############
- var logInterval = setInterval(function(){
- varFilter = $('#filterBy').val();
- initializeLogTbl(varFilter);
- }, 50000);
The actual setInterval works. But...
- There are situations where user action hides the table, so I want to pause setInterval
- In addition, the table container needs to be hidden.
- Then when the table container is shown once again, then I need to restart the setInterval
Following is my attempt at pausing the setInterval and hiding the table container:
- $('#activityLog').hide(clearInterval(logInterval));
When I'm testing I set the timer interval to 500 or 5000. When I click the applicable button, the clearInterval is definitely working, but $('#activityLog').hide() does not always work. Sometimes it does, and sometimes it doesn't.
So.. my questions are as follows:
- How can I make sure the .hide() always works? Do you think the intermittent might have something to do with my shortened timer intervals?
- How can I restart the setInterval when a user .shows the table container again?
Thanks for your help in advance - Pavilion
- 27-Jun-2013 09:45 AM
- Forum: Using jQuery Plugins
I've an html table dynamically constructed in a php file. The table id is logTable
When the user page is loaded, I use $.getJSON to grab the table and display it on the user page as follows:The console.log is reporting the correct class. So I'm able to successfully use $('#activityLog') to grab appropriate table information.$.getJSON("ol_LogTable.php", {filterVal:1},function(data) {$('#activityLog').html(data);varLogClass = $('#logTable').attr('class');console.log("log Class: "+ LogClass);$('#logTable').dataTable();});
But the initialization$('#logTable').dataTable();
Is still not producing anything in the header area.
The initialization does produce the following message if the table has no records:
But the headers are still not capable of sorting, the search input is only visible sporadically, and when it is visible it doesn't work.No data available in table
Showing 0 to 0 of 0 entries
PreviousNext
Any advice would be appreciated.
Thanks in Advance: Pavilion- OK - I didn't think this was going to cause me such big headaches.
I have the following function:- function getTimeStamp() {
- var now = new Date();
- return ((now.getMonth() + 1) + '/' + (now.getDate()) + '/' + now.getFullYear() + " " + now.getHours() + ':'
- + ((now.getMinutes() < 10) ? ("0" + now.getMinutes()) : (now.getMinutes())) + ':' + ((now.getSeconds() < 10) ? ("0" + now
- .getSeconds()) : (now.getSeconds())));
- }
Until this morning - the function resided in a page I was developing, and when I called it I got the desired results.
But - since I will want to use timestamps on other pages as well - I decided to put this function in a custom.function.js file and call it from there. I included the file in my <head></head> section. I'm calling the function the same way I always have ...- $("#findTime").click(function() {
- var tmStamp = getTimeStamp();
- console.log("inside click: " + tmStamp);
- });
But now - I'm not getting ANYTHING returned. Do I have to call the function differently when I move it from the content page to custom functions file?
Thanks in advance - Pavilion- Hello
Does anyone here know anything about CKEditor?
I've got it installed on my site and it works great in FireFox and Chrome. But IE 9 is causing problems.
For some reason I can't destroy the CKEditor instance in IE 9. Following is my script:- $("#ckSubmit").click(function(){
- // grab reply editor data
- var editor_data = CKEDITOR.instances.replyTxtarea.getData();
- // Push getActivityID and editor_data into array
- // getActivityID; is activityID variable from $(document).on('click','.details_button',function() {
- var postRply_Array = new Array();
- postRply_Array.push({activityID:getActivityID, replyTxt:editor_data});
- $.post("ol_postActivity.php",{postReply_Ary:postRply_Array},function(data){
- $.getJSON("ol_LogPosts.php", {actID:getActivityID}, function(data) {
- $('#postDiv').html(data);
- });
- $("#filterBy").val(1);
- });
- // set textarea data to empty, then destroy the ckeditor instance so it's completely cleared out.
- CKEDITOR.instances.replyTxtarea.setData('');
- CKEDITOR.instances.replyTxtarea.destroy();
- $("#replyTxtarea").hide();
- $(".postReplyBttn").show();
- $("#ckSubmit").removeClass('ol_shownTR').addClass("ol_hidden");
- });
Everything works great (in all browsers) accept line 18: CKEDITOR.instances.replyTxtarea.destroy();
Does anyone have any idea what is going on? The line right before it uses basically the same syntax to setData(''); and empty the CKEDITOR instance. But - IE 9 is NOT destroying the instance.
OH - one other thing. In IE - the script stops executing at line 18 - because the following jQuery lines, hiding elements, do not execute.
Thanks in advance:
PavilionHello:
I'm having a problem with the Cleditor iframe. Following is a screen shot, even though my height setting is 300, this only controls the textarea box. It does not control the iframe. When I paste large quantities of text into the editor, the text overflows the textarea and pushes the iframe out. See image below:As you can see the text is overflowing the actual cleditor. The red border shows the iframe, as I added border settings to the iframe within the cleditor.css file - the settings are changed as follows:
- .cleditorMain iframe {border:8px solid red; margin:0; padding:0}
So .. now that I can prove the text is overflowing the cleditor control because of the iframe height, how can I address the problem. Putting a max-height in the iframe settings (as I did for the border) does not solve the problem.
Thanks in advance - Pavilion- Hello Everyone:
I am using a jQuery .map(function() to iterate through a table and compile an array. My problem is pretty straight-forward. How do I test for duplicates, so the resulting array has unique subarrays? Following is my script:- // use .map function to iterate through the tables <select objects
- post_ParticipantsArray = $(".grpBK_O1 select").map(function(){ // mapping table with class ".grpBK_O1" selects
- // now set variables for assembling the array
- var row_ID = this.id; // this.id is jQuery for javascripts: $(this).attr('id');
- var rowArray = row_ID.split("_");
- var membID = rowArray[1];
- var varPrivilegesID = $(this).val();
- // return {} pushes the variables into the post_ParticipantsArray. It is "returning" the array to post_ParticipantsArray.
- return {participantID:membID, PrivID:varPrivilegesID};
- }).get();
- console.log("post participantArray: " + JSON.stringify(post_ParticipantsArray));
The console.log produces the following:
As you can see, there are multiple duplicate subarrays. Users can choose multiple groups in this table. If one individual belongs to more than one group, there will be duplicate subarrays. So...[08:02:50.240] post participantArray: [{"participantID":"3601","PrivID":"2"},{"participantID":"53467","PrivID":"2"},{"participantID":"3601","PrivID":"2"},{"participantID":"62882","PrivID":"2"},{"participantID":"53284","PrivID":"2"},{"participantID":"3601","PrivID":"2"},{"participantID":"5","PrivID":"2"},{"participantID":"62882","PrivID":"2"},{"participantID":"53285","PrivID":"2"},{"participantID":"53467","PrivID":"2"},{"participantID":"66396","PrivID":"2"}]- How do I prevent duplicate subarrays in the map function?
- If that is not possible, how do I take the resulting array and extract any duplicates?
Thanks in advance:
Pavilion- Hello:
I've just finished writing a routine to do the following:- Use $.post to grab a dynamically produced php table and display it in a "group" container. The table shows 1 line for each group member, and their privileges.
- Use $(".grpBK_O1 select").map(function(){ to iterate through the resulting member table and grab the value of the privileges <select object.
- Assign values to variables that will be pushed into an array
- Use $.each(memberID, function() { to test and process EVERY memberID
- Use $.grep(grpPrivilege_array, function(v,i) { within the $.each() to figure out if there are duplicates in the array - BEFORE pushing
- Use if (result=='') to do an array push
What bothers me - from an efficiency perspective - is how many different procedures I'm using to accomplish this. Following is the actual script:- if (grpCheck == true)
- {
- // Open Group detail section so user can assign privileges
- // ### grab data (group members and privileges) and display in detail section
- $.post("ol_list_grpMembers_O1.php",{bind_grpID:grp_ID},function(data){
- $(grpContainer).removeClass('ol_hidden').addClass('ol_shownTR');
- $(grpContainer + ">td").html(data);
- // iterate through the <select objects
- values = $(".grpBK_O1 select").map(function(){
- // now set variables for assembling the array
- row_ID = this.id; // this.id is jQuery for javascripts: $(this).attr('id');
- memberID = row_ID.split("_").pop(-1);
- grpPrivilegesID = $(this).val();
- // Use $.each to test each memberID against grpPrivilege_array for possible duplicates.
- $.each(memberID, function() {
- // Use Grep to find duplicates.
- var result = $.grep(grpPrivilege_array, function(v,i) {
- return v['participantID'] === memberID;
- });
- // If the grep result is empty '', then push memberID and grpPrivilegesID into grpPrivilege_array
- if (result=='')
- {
- grpPrivilege_array.push({participantID:memberID, PrivID:grpPrivilegesID});
- }
- });
- return grpPrivilege_array;
- }).get();
- console.log("result array: " + JSON.stringify(grpPrivilege_array));
- });
- // Set background color of row
- $(this).closest('tr').css('background-color', '#85a888');
- }
jQuery is newish to me - but I've decades of experience in other languages. And it is a bit concerning to me that I'm nesting so many different types of functions to accomplish the goals outlined above.
Is there a more efficient way to accomplish my goals?
Thanks in advance: Pavilion- 13-Mar-2013 08:45 PM
- Forum: Using jQuery
Hello
I've got a php dynamically constructed table in one file: ol_list_ActivityPrivileges.php
In my main file - the table is pulled in through the following script:- $.getJSON("ol_list_ActivityPrivileges.php", function(data) {
- $('#address_Book').html(data);
- });
The table comes through perfectly, and forms the html just as I figured it would. The problem is when I try to run jQuery listeners on the html elements (such as click event on a button), the jQuery doesn't fire.
Why is this and how do I solve the problem?
Thanks in advance: Pavilion- 12-Mar-2013 09:54 PM
- Forum: Using jQuery
So... I figured out how to add items to a pre-existing array. Following is the applicable script snippet:- catch_array["privilegesID"] = []; // Declare a new associative key in the catch_array.
- catch_array.privilegesID.push(varPrivilegesID); // Add varPrivilegesID to catch_array, assign it to the associative key.
- console.log("data row After processing: " + JSON.stringify(catch_array));
It works great, except for one issue. When I run it to the console.log the added array items do not output the same way as items that have been in the array all along. A sample output follows:- [{"CrossRefID":"50917","BookOwner":"5","AddressOwner":"53284","UserGroup":"Admin","Active":"1","privilegesID":["2"]}]
How do I get rid of the [] brackets?
Thanks in advance - Pavilion- Hello:
I didn't think this would be so difficult, but then again...
I've got a table with a checkbox in the first <td> and a <select><option>. When The checks the checkbox and it is true, then I want to populate the <option>.
How do I do that? I just want to populate it with a value from the option list and give it the appropriate val().
Thanks in advance:
Pavilion- I am trying to get the Trent Richardson Timepicker up and running. For the most part it is up and running, but I've one problem.
My datetime input is set up as follows:- $("#startDate").datetimepicker({
- showSecond: false,
- timeFormat: 'hh:mm:tt',
- hourGrid: 4,
- minuteGrid: 15,
- stepHour: 1,
- stepMinute: 15,
- hourMin: 8,
- hourMax: 20
- });
Now for the problem - following is my listener function:- $("#startDate").change(function(){
- var startDate = $(this).val();
- console.log("Inside start Date Change: " + startDate);
- });
- [20:45:53.615] Inside start Date Change: 02/19/2013 08:00:am
- [20:45:57.070] Inside start Date Change: 02/19/2013 09:00:am
- [20:45:57.114] Inside start Date Change: 02/19/2013 10:00:am
- [20:45:57.157] Inside start Date Change: 02/19/2013 11:00:am
- [20:45:57.280] Inside start Date Change: 02/19/2013 12:00:pm
- [20:45:57.642] Inside start Date Change: 02/19/2013 01:00:pm
- [20:45:59.515] Inside start Date Change: 02/19/2013 01:15:pm
- [20:46:00.141] Inside start Date Change: 02/19/2013 01:30:pm
Since every action with the sliders are a "change", the .change event is returning multiple date/time results instead of the final selection.
Does anyone have any idea what event I can use to only grab the final selection? the .click() event does not work either.
If there is no other jQuery event that can be used in this situation, how do I only grab the last date/time return?
Thanks in Advance - Pavilion- Hello:
I'm having a problem with order of operations, and hoping someone here can help. The routine in question, deletes members from a group, and then displays the new group membership without deleted members. The routine uses two different files, because the select query used for displaying group members is called in other routines within the application. It only makes sense to use the same SELECT statement in the same file (easier maintenance). Following is the snippet of code in question:- //======================== Delete selected individuals from Group =======================
- $('#removeMember').click(function() {
- var removeAnswer = confirm("Do you really want to remove the selected user(s)?");
- if (removeAnswer){
- $.post("org_users_data6.php",{bind_MemberArray:MemberArray},function(data){
- console.log("1st Post Return: " + MemberArray);
- });
- $.post("org_users_data5.php",{bind_GrpArray:grpID_Array},function(data){
- console.log("2nd Post Return: " + data);
- $('#MemberBody').html(data);
- });
- // Reset select options to reflect deleted group
- $('#AddMemberOpt').html('Add Individuals to <b><u>ONE</u></b> Selected Group');
- // Reset applicable Arrays - so that deleted members don't remain in play for other procedures.
- MemberArray = new Array();
- tableRow = '';
- }
- // ### ADDED: 01-27-13 to reset and clean after action
- $('#new_OrgGrp').val('');
- $('#GroupSelect').val(0);
- });
The problem is that sometimes the above routine executes in order (with the first $.post executing BEFORE the second $.post) and all is well.
But, if I run the routine repeatedly (by deleting members multiple times - one right after the next) then the routine runs out of order. My console log shows console.log("2nd Post Return: " + data); BEFORE console.log("1st Post Return: " + MemberArray);. The end result is that the member is deleted, but the returned recordset does NOT reflect the deletion.
It is entirely probable that users would delete contacts from the group, and then realize they forgot to delete a contact, and run a second delete.
Does anyone have any idea why the above $.posts do not execute in order on multiple delete actions? And how do I solve the problem?
Thanks Much:
Pavilion- Hello:
I've a small problem and am hoping someone here knows the answer. Following is my jQuery snippet:- window.location.reload();
- // after reloading ... select userGrps_tab
- $items.removeClass('selected');
- index = 2;
- $('#userGrps_tab').addClass('selected');
- $('#vtab>div').hide().eq(index).show();
As you can see the window.location.reload(); is the 1st command.
However ... when this snippet runs, the userGrps_tab is selected and THEN the window.location.reload() takes place...
Anyone have any idea why???
And what is the solution???
Thanks Much:
Pavilion- 20-Dec-2012 10:51 PM
- Forum: Using jQuery
Hello Everyone:
My goal here is to extract a sub-array from a multi-dimensional array. As users select and unselect a checkbox the array needs to be added to or subtracted from. Details follow:- catch_array = jQuery.parseJSON($(this).val());
catch_array variable picks up value of the checkbox. The value is an array of fields in the table row, (firstName, lastName, email, userID, etc...)
Next If routine should add to the data_row array or subtract from depending on whether a user selects (or unselects) a checkbox:- if (check == true)
- {
- data_row.push(catch_array);
- }
- else
- {
- var removeData = catch_array;
- data_row = jQuery.grep(data_row, function(value) {
- return value != removeData; });
- }
The problem is that jQuery.grep() is not working the way it does if I am just working with a simple array.
Does jQuery.grep not work with multi-dimensional arrays? And if not, how do I subtracted a sub-array from a multi-dimensional array?
Thanks In advance:
Pavilion- Hello Folks:
I'm trying to iterate through a table's <tr>s. To some degree I've found success. But have gotten stuck on testing for checked in a row's checkbox. Following is my current attempt:- $("#address_bk").find("tr").each(function() { //get all rows in table
- var chkTest = $(this).find('td.selectChk').find('.Record_Chk').is(':checked');
- console.log("Check Test: " + chkTest);
- });
console.log only returns chkTest for the selected row.
However - if I use the following syntax, then console.log returns ('.Record_Chk').val(); for EVERY Row- $("#address_bk").find("tr").each(function() { //get all rows in table
- var chkTest = $(this).find('td.selectChk').find('.Record_Chk').val();
- console.log("Check Test: " + chkTest);
- });
So ... how come the iteration works successfully for .val() and not for .is(':checked')?
Thanks in advance for your help:
Pavilion
P.S. I've also tried .attr('checked'), and it doesn't work any better.- Hello Folks:
I'm working on my first application which uses jQuery extensively. So far, I've got the first basic pages done. Registration, uploading contacts, profile pages for individuals and organizations, and making own groups. They all work great on my two computers. My desktop is a bit older (Windows XP) than my laptop (Windows 7) and I've tested the work in all the major browsers.
Today I am testing this application on my daughter's really old laptop with Windows Vista. This testing is necessary because my application will be used in small offices, a lot of which will be non-profits with low budgets. So.... I feel the need to test on older computers. Now for the problem ...
JQuery is NOT working in any browser on Windows Vista. We've downloaded Javascript and we've checked options to make sure javascript is enabled in the browser.
Does anyone have any idea why it is NOT working in Windows Vista? Or... what other troubleshooting should I be doing?
Thanks in advance:
Pavilion- Hello:
I'm working with a jQuery constructed table. The table assembles wonderfully. Now I want to grab the text() of the 2nd <td> on the row I've selected. But I can't figure out how to do it. Following are the details:
construction syntax:- function rowBuilder(data) {
- return '<tr class="myRows">'
- + '<td class="e_lay"><input type="checkbox" class="Grp_Chk" value=' + data.GroupID + '></td>'
- + '<td class="b_lay GrpName">'
- + data.GroupName
- + '</td>'
- + '<td class="c_lay">'
- + data.Grp_CreateDate
- + '</td>'
- + '</tr>';
- }
When the first <td class="Grp_Chk"> is checked I want to grab the text() of the 2nd <td class="b_lay GrpName">. The syntax I am using follows:- var GroupName = '';
- $('#GroupList').on('click', '.Grp_Chk', function() {
- var grpCheck = $(this).is(':checked');
- groupID = $(this).val();
- GroupName = $(this).find(".GrpName").text();
- console.log("group Name: " + GroupName);
- });
Nothing is returned for a value. I've tried $(this).closest and $(this).next all to no avail.
How do I get the text() for the second <td> in the row I select with the checkbox???
Thanks in advance - Pavilion- Hello:My application has a jQuery constructed table, that works quite well. But... I can't get the <tbody to scroll. No matter what I do. Whether I use CSS or inline styling, the scrolling doesn't work. And I'm wondering if it's not picking up max-height and scroll settings because the table is constructed with jQuery. You can see how the table is constructed in this thread. Following are the applicable scripts:HTML table w/inline styling:
- <table id="GroupList" class="layout">
- <tbody style="background:yellow; overflow-y: scroll; overflow-x: hidden; max-height: 100px;"></tbody>
- </table>
The table is picking up the background setting, because the table body is yellow: But... the table does not pick up the max-height setting, nor does it pick up the overflow settings.Following is the jQuery used to build the table:rowBuilder(data) function- function rowBuilder(data) {
- return '<tr>'
- + '<td class="b_lay">'
- + data.GroupName
- + '</td>'
- + '<td>'
- + data.Grp_CreateDate
- + '</td>'
- + '<td>'
- + '<button type="button" class="toggle_Bttn" value=' + data.GroupID + '>Members</button>'
- + '</tr>';
- }
$('#new_OrgGrp_Save').click(function()- $('#new_OrgGrp_Save').click(function() {
- var NewOrgGrp = $('#new_OrgGrp').val();
- $('#new_OrgGrp').val("");
- $.post("org_users_data4.php",{bind_NewGrp:NewOrgGrp},function(data){
- $("#GroupList > tbody").empty();
- $('#GroupList').append(HeaderRow);
- $.getJSON("org_users_data4.php", function(data) {
- $.each(data, function(i, val) {
- $('#GroupList').append(rowBuilder(val)); //======== See custom.functions.js for rowBuilder() ============
- });
- });
- });
- });
So... is it possible that the construction process is interfering with the <tbody> ability to pick up overflow and max-height settings????Any insight from folks here would be greatly appreciated.Thanks Much:Pavilion- Hello -I've a bit of a unique problem and am hoping to get some advice. Following are the details:
- I've a table I'm building with jQuery .append(). The process is as follows:
- A rowBuilder(data) function stored in a custom function.js file
- The rowBuilder(data) function defines the table row including a toggle button
- A $('#new_OrgGrp_Save').click(function() which saves the new organization group and then repopulates the table with rowBuilder(data). Following are the applicable scripts:
rowBuilder(data) function- function rowBuilder(data) {
- return '<tr>'
- + '<td class="b_lay">'
- + data.GroupName
- + '</td>'
- + '<td>'
- + data.Grp_CreateDate
- + '</td>'
- + '<td>'
- + '<button type="button" class="toggle_Bttn" value=' + data.GroupID + '>Members</button>'
- + '</tr>';
- }
$('#new_OrgGrp_Save').click(function()- $('#new_OrgGrp_Save').click(function() {
- var NewOrgGrp = $('#new_OrgGrp').val();
- $('#new_OrgGrp').val("");
- $.post("org_users_data4.php",{bind_NewGrp:NewOrgGrp},function(data){
- $("#GroupList > tbody").empty();
- $('#GroupList').append(HeaderRow);
- $.getJSON("org_users_data4.php", function(data) {
- $.each(data, function(i, val) {
- $('#GroupList').append(rowBuilder(val)); //======== See custom.functions.js for rowBuilder() ============
- var Id = $(".toggle_Bttn").val();
- console.log("ID: " + Id); //properly reads and reports the class (".toggle_Bttn")
- });
- });
- });
- });
In addition - the following snippet properly reports out the ID number- var Id = $(".toggle_Bttn").val();
- console.log("ID: " + Id); //properly reads and reports the class (".toggle_Bttn")
Now - here is the problem, if I design a selector for the ".toggle_Bttn" class, I can't get it to work. Following is my current attempt:- $(".toggle_Bttn").click(function() {
- console.log('Inside Toggle');
- });
So.... is it not possible to create a selector for a class of buttons in a table generated by a function in another file???? Or... what am I doing wrong here????Thanks in advance:Pavilion- Six Months ago I started another thread about json_encoded arrays, because I was having trouble grabbing data.
That thread did give me some solutions, and until just a couple days ago I had no problems. However, now I am having problems with characters like slashes and commas. Following are the details:
Php script encoding the array- echo "<td class='e'><input type='checkbox' class='Record_Chk' value='". json_encode($row_array) ."'></td>";
- $('.Record_Chk').click(function() {
- var check = $(this).is(':checked');
- var catch_array = $(this).val();
- var data_row = jQuery.parseJSON(catch_array);
- console.log("test: " + catch_array);
- });
For the most part output from catch_array is great. But yesterday I uploaded some contacts with job titles that have characters which are causing problems. For instance:- Job title: Special Assistant to the BOS & TM/Human Resource Director returns as
- Assistant to the BOS & TM\/Human Resource Director
Also ...- Job Title: Veteran's District Director returns as
- Veteran
In addition - the code stops executing altogether when it runs into a '
Any assistance with this problem would be greatly appreciated.
Thanks in advance:
Pavilion- «Prev
- Next »
Moderate user : pavilionwi
© 2013 jQuery Foundation
Sponsored by
and others.


