openpsa / jsgrid

Fork of last jqGrid version before license change
http://openpsa.github.io/jsgrid/
Other
28 stars 12 forks source link

ReferenceError: thd is not defined #28

Closed himiklab closed 9 years ago

himiklab commented 9 years ago

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 commented 9 years ago

Do you have an example demo which shows this problem?

himiklab commented 9 years ago

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 commented 9 years ago

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

bouks commented 9 years ago

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

OlegKi commented 9 years ago

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 commented 9 years ago

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

Thanks!

flack commented 9 years ago

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

flack commented 9 years ago

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 commented 9 years ago

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

bouks commented 9 years ago

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

bouks commented 9 years ago

Fixed in pull request :

https://github.com/openpsa/grid.js/pull/40

commit :

https://github.com/bouks/grid.js/commit/21f3592afaae100abb09d4c1f361149ae489b380

meh-uk commented 9 years ago

Pull accepted, I guess this can be closed now.

himiklab commented 9 years ago

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;".

bouks commented 9 years ago

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 commented 9 years ago

@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 commented 9 years ago

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

It works on my tables.

meh-uk commented 9 years ago

Yeah it's with the latest code.

bouks commented 9 years ago

@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 commented 9 years ago

Be aware of your navigator's cache. :)

meh-uk commented 9 years ago

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

bouks commented 9 years ago

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

meh-uk commented 9 years ago

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 commented 9 years ago

Its now fixed in 05f14469e3a068e1c9ee044d1cde611ec1a99852

meh-uk commented 9 years ago

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

bouks commented 9 years ago

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

himiklab commented 9 years ago

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 commented 9 years ago

Can you file a new issue please?