Skip to content
This repository has been archived by the owner on Jan 1, 2020. It is now read-only.

ReferenceError: thd is not defined #28

Closed
himiklab opened this issue Jan 11, 2015 · 27 comments
Closed

ReferenceError: thd is not defined #28

himiklab opened this issue Jan 11, 2015 · 27 comments
Assignees
Milestone

Comments

@himiklab
Copy link
Contributor

Does not work filterToolbar, gives an error:

ReferenceError: thd is not defined
...),a("span.ui-search-input",p).append(u),a(thd).append(p),a.jgrid.bindEv.call(c,u...
@meh-uk
Copy link
Contributor

meh-uk commented Jan 11, 2015

Do you have an example demo which shows this problem?

@himiklab
Copy link
Contributor Author

Filter toolbar is not displayed without any errors. jQgrid 4.7 work good.

<table id='jqGrid-w1'></table>
<div id='jqGrid-pager-w1'></div>
jQuery("#jqGrid-w1").jqGrid({
    "url": "admin/jqgrid?action=request",
    "datatype": "json",
    "mtype": "POST",
    "pager": "#jqGrid-pager-w1",
    "colNames": [
        "language",
        "title"
    ],
    "colModel": [
        {
            "name": "language",
            "index": "language",
            "editable": false
        },
        {
            "name": "title",
            "index": "title",
            "editable": false
        }
    ],
    "rowNum": 5,
    "autowidth": true,
    "height": "auto",
    "multiSort": true
})
.navGrid('#jqGrid-pager-w1', {
    "edit": true,
    "add": true,
    "del": true,
    "search": true,
    "view": false
},
{
    "url": "admin/jqgrid?action=edit"
},
{
    "url": "admin/jqgrid?action=add"
},
{
    "url": "admin/jqgrid?action=del"
},
[],
{})
.filterToolbar({
    "stringResult": true
})

@meh-uk
Copy link
Contributor

meh-uk commented Jan 11, 2015

Brilliant :). I'll take a look next week unless someone beats me to it!

@bouks
Copy link
Contributor

bouks commented Jan 11, 2015

Maybe my changes may have not be re-applied well after the folders revert, since i had remove thd.

@OlegKi
Copy link
Contributor

OlegKi commented Jan 11, 2015

Sorry @himiklab , but are you sure that you really uses jqGrid 4.7? If you would open jquery.jqGrid.min.js and would search for "span.ui-search-input" or for (thd you will don't find and match. So please specify the version which you use more exactly it it's possible.

I suspect that you use the current version of jqGrid from https://github.com/openpsa/grid.js. The line contains the reference to undefined variable. It's the bug in the commit. The $(thd) should be probably fixed to $(th). (One should take in the consideration that the link to the line which I included above can be point to another line after the code will be modified).

Best regards
Oleg

@himiklab
Copy link
Contributor Author

Yes, i use current version grid.js-4.7.0.min.js from https://github.com/openpsa/grid.js.

Thanks!

@flack
Copy link
Contributor

flack commented Jan 11, 2015

It seems I overlooked one line when I re-applied the search toolbar patch. Should be fixed now.

@flack
Copy link
Contributor

flack commented Jan 11, 2015

P.S.: It would be cool to turn the code sample above into a unit test (basic smoketest, just see that no error is thrown)

@himiklab
Copy link
Contributor Author

In last release. Error disappeared, but the panel does not appear.
Maybe something has changed in API?

@himiklab himiklab reopened this Jan 12, 2015
@bouks
Copy link
Contributor

bouks commented Jan 12, 2015

It's a css bug. Necessary css has not been applied.
I do a fix quickly.

@bouks
Copy link
Contributor

bouks commented Jan 12, 2015

@meh-uk
Copy link
Contributor

meh-uk commented Jan 12, 2015

Pull accepted, I guess this can be closed now.

@himiklab
Copy link
Contributor Author

Better, but still not working.

<div class="ui-search-box">
    <span class="ui-search-input" style="display: none;">
        <input id="gs_language" type="text" value="" name="language">
     </span>
     <span class="ui-search-clear">
         <a class="clearsearchclass" title="Clear Search Value">x</a>
     </span>
</div>

Problem in style="display: none;".

@meh-uk meh-uk self-assigned this Jan 12, 2015
@bouks
Copy link
Contributor

bouks commented Jan 12, 2015

No. That's because i didn't push the min dist css, i only pushed the less file. I'll do it quickly.

Sorry.

@meh-uk
Copy link
Contributor

meh-uk commented Jan 12, 2015

@bouks I don't think that's the issue. I've created a demo on my machine and I can reproduce the problem with a brand new build.

@bouks
Copy link
Contributor

bouks commented Jan 12, 2015

@meh-uk have you used the modified css in the less file ?

It works on my tables.

@meh-uk
Copy link
Contributor

meh-uk commented Jan 12, 2015

Yeah it's with the latest code.

@bouks
Copy link
Contributor

bouks commented Jan 12, 2015

@meh-uk I've send you by email my css file after lessc. Test with it.

It works perfect in my projects. FF, IE11 and Chrome tested

@bouks
Copy link
Contributor

bouks commented Jan 12, 2015

Be aware of your navigator's cache. :)

@meh-uk
Copy link
Contributor

meh-uk commented Jan 12, 2015

It is definitely still a problem! Perhaps you use search operators, if you do then it will work.

@bouks
Copy link
Contributor

bouks commented Jan 12, 2015

What do you mean by "Perhaps you use search operators" ?

@meh-uk
Copy link
Contributor

meh-uk commented Jan 12, 2015

If the searchOperator option is set to true, then it would all display as you'd expect. I've fixed the problem and I'm about to commit.

@meh-uk
Copy link
Contributor

meh-uk commented Jan 12, 2015

Its now fixed in 05f1446

@meh-uk
Copy link
Contributor

meh-uk commented Jan 12, 2015

@himiklab let me know if you have any more problems :).

@bouks
Copy link
Contributor

bouks commented Jan 12, 2015

I just fixed the bug and see you do.Thanks. :)

@himiklab
Copy link
Contributor Author

Thanks!

But another question. :) In the original jqgrid width of the search field was the same as the width of the column, it is now fixed.

@meh-uk
Copy link
Contributor

meh-uk commented Jan 13, 2015

Can you file a new issue please?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants