GithubHelp home page GithubHelp logo

openpsa / jsgrid Goto Github PK

View Code? Open in Web Editor NEW
28.0 28.0 12.0 18.54 MB

Fork of last jqGrid version before license change

Home Page: http://openpsa.github.io/jsgrid/

License: Other

JavaScript 96.85% CSS 3.15%

jsgrid's People

Contributors

aaronj1335 avatar amirulali avatar bouks avatar brain90 avatar claytonsilva avatar danielpetroianu avatar davec avatar dvdotsenko avatar ericsmekens avatar flack avatar fpape avatar henryyan avatar jackysee avatar justinethier avatar kirilvit avatar kunalkumar avatar laurentgoncalves avatar lukasz-schab avatar meh-uk avatar msajko avatar olegki avatar pbor avatar pro85 avatar ralphbean avatar rmagrin avatar rohitggarg avatar scottwoodall avatar smartcorestudio avatar tonytomov avatar tpeczek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jsgrid's Issues

bug gridComplete option function call change (maybe others)

Consider this option.

  • gridComplete: jqGridMethod.setPager

where

var jqGridMethod = {
    setPager: function() {
       console.log($(this));
    },
    otherfunction: ...
    ...
}

Until now and in all my projects the call was good and $(this) echoed the grid.

Now it doesn't work anymore. First i have to put parenthesis to enter function, like :

  • gridComplete: jqGridMethod.setPager()

and then $(this) echoe the object jqGridMethod.

user definable footer summaries via drop down

A nice feature to add is a button that toggles a row to appear above the footers that would contain drop downs with summary options based on the content of the cell. For integers, for example, it could show (count, min, max...) Please see the below example, which I have taken from my own table function which I have created and implemented this in.

example summary drop down

Check files in plugins directory

Most of the files in the plugin directory are quite old and most probably don't work any more. We should check which ones can be removed

Make JSON data viewable in demos

As per @flack's comments in pull #17.

well, with enough time and energy, you can implement almost anything :-)

The only drawback I see is that if we're adding some custom handlebar functions to do this is that then the markdown file itself will get less readable, i.e. when you view it in a text editor (or on github). What we could do though is implement this in Javascript and run it on the client side. Bascially intercept the ajax response and print it on screen somewhere.

The code that renders the grid on screen is here:

https://github.com/openpsa/grid.js/blob/master/docs/template/ui.js#L10

It's not very pretty, I know. An implementation idea for intercepting the http response would be to splice some ajaxGridOptions handler into the text read from the codetag. It's a bit of a hack of course, so if you know a cleaner way to do this go right ahead :-)

LESS or not

This question has been asked several times in different places, so i propose we discuss it and vote here to close the question.

I vote for less.

Clicking inline editing buttons should not remove selection

To reproduce:

Expected Result:

  • inline editing opens and row stays selected

Actual Result:

  • inline editing opens and selection is removed

This currently happens only when multiselect is true, but it will happen in single select, too if we implement #2

I haven't looked at the code yet, but I think we should prevent the click events of the inline buttons from bubbling (and call select explicitly so that we are sure the row is selected)

Investigate use of colgroup

Currently, if you set e.g. hidden: true in colModel, style="display: none" is added to each cell in the column. Performance might be better if we define a colgroup instead, because then the runtime for setting these properties would be O(1) instead of O(n). Markup would then look like this:

<table id="grid">
    <colgroup>
        <col style="display: none">
        <col style="text-align: right">
    </colgroup>
    <tr>
        <td>This is the hidden column</td>
        <td>This is the right-aligned column</td>
    </tr>
</table>

Date filtering issue

Taken from jqGrid #674
newformat is applied in parsedate() even when the date has already been converted. This breaks the filtering of dates when newformat differs from srcformat.

To recreate:
Input is 2014-09-08;
datatype = local; // I assume this is a/the culprit
srcformat = 'Y-m-d';
newformat = 'n/j/Y';
Enable filter toolbar.

The grid shows 9/8/2014, but won't filter correctly because when filtering jqGrid is trying to apply 'Y-m-d' to 9/8/2014.)

jquery minimum version needed

Hi all.

Maybe we should do jquery 1.8.3 minimum version needed.
1.8.3 is the last version (november 2012) before 1.9 (that include major changes).
Between 1.7 and 1.8.3 are mainly bugfixes.

Check files in external directory

There are a couple of bundled third-party libraries in the external directory, mostyl four years old or more. At least jqModal has seen some development since. We should check which libs can be updated, or ideally installed via Bower

optimizing css in grid

Avoid styling things which should not be in html (and therefore in the js code).

  • remove inline css rules if possible
  • remove classes that are only "aliases" or "override" to css rules.
  • make the use of pure css selectors.

Add support for CSS-only zebra striping

Currently, it is not possible to implement CSS-only zebra striping, because hidden rows (e.g. collapsed groups or collapsed child levels) have the same classes as visible ones. So if you have a CSS rule like

.ui-jqgrid-btable tr.jqgrow:nth-child(2n+1)
{
    background-color: gray
}

it will only work in simple cases, but it will produce wrong results if some of the rows are hidden.

So I would propose adding a class like jqrow-visible to all visible rows, then we could write

.ui-jqgrid-btable tr.jqgrow-visible:odd
{
    background-color: gray
}

without needing altrows and altclass config options

ReferenceError: thd is not defined

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

setting the height property causes the horizontal scroll to unnecessarily appear

Setting the "height" property causes the horizontal scroll to unnecessarily appear when the vertical bar is needed. (This happens in Chrome but not in IE. Haven't tested it in any other browser.)

Even if the "width" property is defined and is more than wide enough to handle the table, the issue still occurs.

Example shown here: https://www.tesllc.aero/temp/jqgrid/

The only way that I have been able to temporarily fix this is by adding the following css:

.ui-jqgrid .ui-jqgrid-bdiv {  overflow-x:hidden; }

Not all jqGrid file are included in the build

Hi,

I do made some changes in my repository to reduce the size of resulting jquery.jqGrid.min.js. I don't planned to do to make such changes before, but the results was too good: i could reduce the size of jquery.jqGrid.min.js by the last changes from 282 KB (289.272 bytes) till 275 KB (282.532 bytes) in the current version.

After that I compared the size of grid.js-4.7.0.min.js and grid.js-4.7.0.js with the size of jquery.jqGrid.min.js and jquery.jqGrid.src.js from my repository. Your jquery.jqGrid.min.js is smaller. After some additional analyse I've found out that the current build of grid.js-4.7.0.min.js and grid.js-4.7.0.js don't includes the files which you moved in external folder:

jqDnR.js
jqModal.js
jquery.fmatter.js
JsonXml.js

It's a clear bug in the build process which need be fixed.

Best regards
Oleg

Allow multiple rows in footer table

There are some situations where it would be nice if we could have more than one row in the footer table, e.g. when you have an invoice table like this:

Item Price
Item 1 20
Item 2 25
---------
Sum 45
VAT 5
Total 50

i18n english locale

Should we include default english in grid.base.js as it was done in lasts commits ?

If so, shouldn't we remove the english locale in i18n ?

Duplicates are not cool.

In the actual state, some users would include english locale and therefore add unnecessary request to server.

datatype autodetection

Based on @bouks implementation and the feedback from @OlegKi, here's a proposal for a modified autodetection algorithm (written as pseudocode for better readability):

if (grid.datatype !== 'auto')
{
    grid.url = "" + grid.url //Cast URL to string
    //normal jqGrid setup as it was before
}
else
{
    if (grid.data !== null)
    {
        grid.datatype = 'local';
    }
    else if (grid.url !== null)
    {
        detected_datatype = do_ajax_request_and_detect_datatype_with_jquery();
        if (detected_datatype === null)
        {
            throw 'datatype could not be detected. Please specify it manually';
        }
        if (    grid.loadonce === true
            && (detected_datatype === 'xml' || detected_datatype === 'json'))
        {
            grid.datatype = 'local'
        }
        else
        {
            grid.datatype = detected_datatype;
        }
    }
    else
    {
        grid.datatype = 'clientSide';
    }
}

The autodetection should only run once, when the grid is initially constructed.

From the user's point of view, the behaviour would be like this:

Using local data:

$('#list').jqGrid({
    colModel: [ name: "colName"],
    data: some_data
});

using remote data:

$('#list').jqGrid({
    colModel: [ name: "colName"],
    url: "/backend.php"
});

using nothing at all:

$('#list').jqGrid({
    colModel: [ name: "colName"],
}).jqGrid('setGridParam', {data: some_data});

using remote data from the current URL:

$('#list').jqGrid({
    colModel: [ name: "colName"],
    url: ""
});

Builder notice components

It would be cool if the js header comments mention the chosen components in the builder.
So if updates comes, people can remember the components they chose and make the same build.

Tests priority

We've talked about writing tests.

I propose we implement firstly :

  • check if the grid is well populated with the good datas according to
    the ajax returned ones.
  • check, when editing and saving to server (form, inline, cell), that
    the right datas are sended by the ajax call.

The most important thing on the grid is to be sure that users datas won't be corrupted.

Rendering problems with confirmation dialog

This is a follow-up to #79

Currently, the delete confirmation dialog looks like this:

bildschirmfoto 2015-01-26 um 20 41 03

At least three things should be fixed here:

  • popup should be positioned at the center of the grid, or at least on the top left corner of the grid
  • popup title should not be empty (because then the popup titlebar is so small that the close button doesn't fit)
  • there needs to be some padding between the delete/cancel buttons and the hr above them

Adding grouping documentation

The grouping documentation needs adding, and the "new" parameters such as display column and title column also need documenting.

filterToolbar input on ie11 bug (not bug)

I just discover that ie11 add a little 'x' at the end of the input when you fill it.
This 'x' clear the input, but obviously doesn't trigger our search functionnality (reset filter and reloadGrid).

Do we must find a solution and for what milestone ?

Is converting of ui.jqgrid.css from CSS to LESS good?

I don't see sense in converting ui.jqgrid.css from one CSS file to multiple LESS files which have no logic internally. The dist folder don't contains ui.jqgrid.css file. For me personally the information devided in multiple files https://github.com/openpsa/grid.js/tree/master/less is more difficult to read, to compare and to analyse. In any way one need to have static ui.jqgrid.css files which can be loaded from static HTML file and just displays the jqGrid.

To analyse ui.jqgrid.css I personally use always an example of the grid because jqGrid have a lot of jQuery UI classes. In the same way I test the grid together wit Bootsrap. So one have see ui.jqgrid.css *in combination with jQuery UI and other classes from common frameworks. Only analyzing the conflicts with the frameworks allows to set correct CSS rule in ui.jqgrid.css. The topp level jqGrid component with the class .ui-jqgrid (known under the name gbox), another important part .ui-jqgrid-view (gview) and some other will be applied on other CSS rules. The separation in the LESS files makes (at least for me) more difficult to see all classes which will be applied and all looks not like it is in reallity.

It is very difficult to compare the resulting CSS with original ui.jqgrid.css or with ui.jqgrid.css from my fork.

For example look like ui-jqgrid-pager, .ui-pager-control, .ui-jqgrid-toppager and even td select are exist directly under .ui-jqgrid. Such rules on .ui-jqgrid td select seems be applied on the whole grid inclusive jqGrid body (btable) with the main data of the grid. Is it so? Where I can see the resulting ui.jqgrid.css? It would be better to have the file in more compact form so that one can see multiple CSS rules without scrolling vertical, which I need to do permanently if I look at the most LESS files.

It's my main problems in understanding of new `ui.jqgrid.css in LESS formaz...

autodetection of remote datatype (xml or json)

It's the copy of some text from the post

The autodetection of datatype seems a good feature at the first point of view, but ... The first problem: There are some existing backend products which makes autodetection of the format based on dataType used in the Ajax request. For example the WebServices of Microsoft (I mean .ASMX) return XML or JSON depend on it. I'm abrade that such systems will return XML in the case. It you would open the URL in web browser then you would see XML instead of JSON. So such autodetection could change the format returned from the server. jqGrid callbacks, custom formatters, cellattr and rowattr just ptrovide the response as the parameter of the callback. So it makes break the existing code. The code of loadComplete: function (data) { ... var rows = data.rows; ...} will not more work because data.rows will be wrong for XML response.

Moreover, what is real use case of the usage of autodetection? One have to know exact format or returned data to create the grid. If one uses repeatitems: false format then the name property (or jsonmap) should exactly corresponds to the input data. To process XML response one have to write frequently another code. So if somebody use url parameter he have to know the format of data. He knows the type of returned data. So why one should not make datatype mandatory for the remote data? Why one should skip the option. So I don't understand the real case of the usage of autodetection of the format of the server response. I see more disadvantages in the implementation of the feature as advantages.

remove templates in grid.base

I think including templates in grid.base is not a good thing. It makes the program bigger and some people won't use it or create their own templates (what about naming conflicts ?).
We can do separate file for this if we want to offer templates or just let responsability to the user to create templates.

I propose to remove them (they do not exist in jqgrid) included by this commit :

788418f

Filter search field width.

In the original jqGrid width of the search field in filter panel was the same as the width of the column. It is now fixed and narrower.

Switch to Closure Compiler

From #29 (comment) :

If I compile the current jquery.jqGrid.src.js from my my repository with respect of Closure Compiler I get jquery.jqGrid.min.js of the size 275 KB (282.532 bytes), but if I compile the same file using Uglify I get minimized file of the size 277 KB (284.619 bytes). So the usage of Closure Compiler seems be the best choice if one take in the consideration the final results.

https://github.com/thanpolas/grunt-closure-tools

which seems to provide all the configuration we need.

Multiple groups with multiple footers

Multiple sub groups of a master group cause the master group footer to only show if the last sub group is expanded. The group footer should not be a part of the last child.

multiselect checkboxes not working properly

To reproduce:

Expected:

  • checkbox is checked and row is selected

Actual:

  • row is selected and checkbox flickers briefly and is unselected afterwards

I have bisected the issue and it seems to come from here:

89e6507

@bouks: Do you have a code example for the problem you were trying to fix? Because I think we will have to revert this commit and find a better solution. The current implementation also has the side effect that the handlers trigger when you right-click, which is also very annoying

jgrid builder

We could do an advanced builder for end-users where they choose only what they use.

For example, only js (not css), and for uncompressed files (it's only to see % of weight) :

The "base" grid (base, common, custom, filter, formedit, jqueryui, fmatter).
All the extended functions (celledit, grouping, import, inlinedit, pivot, subgrid, tbltogrid, treegrid)
I don't include plugins in this example.

  • Total : 463 ko
  • Base : 348 ko
  • Extendeds : 115 ko

Extendeds are 25% of the total weight.

If i applied in minified :

  • Total : 283 ko
  • Base : 212 ko
  • Extended : 70 ko

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.