Click here to Skip to main content
15,920,836 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have the following code in list.js file to view a table of data :
JavaScript
var usersListScreen = (new function () {
    debugger;
    var me = this;

    me.init = function () {
        debugger;
        $('#myTable').pageMe({ pagerSelector: '#myPager', showPrevNext: true, hidePageNumbers: false, perPage: 5 });

    }


    me.drawTable = function (data) {
        debugger;
        // clear all rows in table
        var templageSTR = $('#userListRowTemplage').html();
        $.each(data, function (index, value) {
            var rowHTML = lib.processTemplate(templageSTR, value);
            $("#myTable").append(rowHTML);
        });

        $('#myTable').find('tr').click(function () {
            main.showPage('UserEdit');
            userEditScreen.showUser($(this).data('index'), 'Edit');

            // from new  userEditScreen.showUser({},'New');
        });
    }


}());


in index.html i have the id that sent to be viewed in a table
XML
<script id="userListRowTemplage" type="text/templage">

    <tr data-index='{{index}}'>
        <td> {{firstName}} </td>
        <td>{{lastName}} </td>
        <td><button type=\"button\" class=\"btn btn-info viewuser\">View User </button></td>
    </tr>
</script>



it keeps giving me an error on
C#
var rowHTML = lib.processTemplate(templageSTR, value);


what does lib stands for how can i use .processTemplate function
Posted
Updated 5-Sep-15 12:49pm
v2
Comments
Sergey Alexandrovich Kryukov 5-Sep-15 21:21pm    
This whole post is a bit fat abuse, nothing else.
How can you create some object without knowing what it means? If you did not write this code, you should not ask about it; it makes no sense.
—SA
May Bash 6-Sep-15 3:41am    
no im practicing JQuery , its not a code i wrote

1 solution

Please see my comment to the question.

In disbelieve, I performed text search on jQuery text, and, not surprisingly, did not find any object named "lib". Therefore, you are just talking about nothing, about some object which, from the state point of the reader of your post, simply does not exist. You did not show how the object is created and did not explain "giving me an error", set aside comprehensive exception information. This is apparent abuse.

But if you did not write this code, this is even greater abuse. Why asking strangers about who-knows-what?

Is there a solution? Certainly. Instead of asking what one or another object means, never ever write a single word you don't understand. Believe me, it works.

—SA
 
Share this answer
 
Comments
May Bash 6-Sep-15 3:43am    
Ok i will never write a single line without knowing its meaning thank you so much for your help
Sergey Alexandrovich Kryukov 6-Sep-15 9:53am    
You are welcome.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900