Looping to create jQuery tabs -


I am trying to create a tab-based alphabet set by employees in a database, thus it will not set a set database Here's the query dynamically created based on employees:

  & lt; Cffunction name = "ALPHA_RL" access = "remote" returnformat = "JSON" return type = "any" & gt; & Lt; Cfargument name = 'DEPTMATRICSID' required = 'true' /> & Lt; Cfset retVal = ArrayNew (1) & gt; & Lt; Cfquery datasource = "# request. DSN #" user name = "# request. User #" password = "# request. Password #" name = "get alfalist" & gt; Select alpha different from (Selection substr (A.LAST_NAME, 1, 1) alpha WEBSCHEDULE.APPLICATION_USER one, WEBSCHEDULE.FACULTYHISTORY H, WEBSCHEDULE.FACULTYTABLE T. Where is A.EMPLID = H.FACULTYEMPLID and A.EMPLID = T.EMPLID and H.DEPTMATRICSID = # ARGUMENTS.DEPTMATRICSID #) where alpha alpha does not have any command & lt; / Cfquery & gt; & Lt; Cfloop query = "getAlphaList" & gt; & Lt; Cfset temp = {} / & gt; & Lt; Cfset temp ['alpha'] = mill alfalfaist LAPHA / & gt; & Lt; Cfset ArrayAppend (Retell, Temp) & gt; & Lt; / Cfloop & gt; & Lt; Cfset result = {} /> & Lt; Cfset result ['item'] = betel / & gt; & Lt; Cfreturn result & gt; & Lt; / Cffunction & gt;  

This works fine and shows the desired data below:

  {"items": [{"ALPHA": "A"}, { {"Alpha": "h"}, {"alpha": "h"}, {"alpha": "b"}, {"alpha": "c"}, {"alpha": "f"}, {"alpha" {"Alpha": "n"}, {"alpha": "o"}, {"alpha"}, {"alpha": "l"}, {"alpha": " "Alpha": "P"}, {"Alpha": "R"}, {"ALPHA": "S"}]}  

Now where I have a problem Html Page I A function was created and the loop threw the above results to create HTML for the tab:

  (Alphabet): {$ .ajax ({url: "CFCs / ManageUserProfiles.cfc", datatype: "JSN", data: {method: "ALPA_RL", Dipitatrosidid: D}, success: function (reaction) {var x = Response.items; var str = ''; if (feedback.imms [0]! = Undefined) {str + = ' ul & gt;'; for (mein = 0; i & lt; x .length; i ++) {str + = '<
  • & lt; a href = "# alphaTabz-' + X [i] .ALPHA + '" & gt;' + x [i]. ALPHA + '& lt; / a & gt; & lt; / li & gt;';} Str + = '& lt; / Ul & gt; '; For (var j = 0; j & lt; x.length; j ++) {str + = '& lt; Div id = "alphaTabz- '+ [x] [J] .ALPHA +'" & gt; '; Str + = '& lt; P & gt; + J + '& lt; / P & gt; '; Str + = '& lt; / Div & gt; '; }} $ ('# DisplayAlphaList'). Attachment (str); }, Error: function (data) {}}); }
  • In this way I call the jquery tab in my document .ready:

      $ ('# displayAlphaList'). Tab (); Var D = '& lt; Cfoutput & gt; # Session.ad.AppDeptID # & lt; / Cfoutput & gt; '; AlphaTab (D)  

    The HRL is ready OK, but call $ ('# displayAlphaList'). Tab () does not recognize the tab, it seems that these are just plain HTML and tabs are not created Thanks in advance for any insights, you can help me.

    You $ ('# displayAlphaList') Tabs () before you make your tabs.

    You need to call $ ('# displayAlphaList'). Tab (); Your 'success' Function

      function alphaTabs (d) {$ .ajax ({url: "CFC / ManageUserProfiles.cfc", datatype: "json", data: {method: "ALPHA_RL", DEPTMATRICSID: D }, Success: function (response) {var x = response.items; var str = ''; if (reaction. Atoms [0]! = Undefined) {str + = '

    Comments

    Popular posts from this blog

    import - Python ImportError: No module named wmi -

    Editing Python Class in Shell and SQLAlchemy -

    c# - MySQL Parameterized Select Query joining tables issue -