Giter Site home page Giter Site logo

robinvanderknaap / mvcjqgrid Goto Github PK

View Code? Open in Web Editor NEW
101.0 21.0 75.0 42.94 MB

Fluent jqGrid Html Helper for ASP.NET MVC

Home Page: www.playground.webpirates.nl/mvcjqgrid

License: GNU Lesser General Public License v3.0

CSS 2.66% C# 66.04% JavaScript 26.12% Batchfile 0.02% HTML 5.17%

mvcjqgrid's People

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

mvcjqgrid's Issues

EnableTreeGrid and JSON data

MvcJqGrid should always render datatype = _dataType
And Also:
If EnableTreeGrid then treedatatype = _dataType

instead of :
// Datatype
script.AppendLine(_enabledTreeGrid
? string.Format("treedatatype:'{0}',", _dataType.ToString().ToLower())
: string.Format("datatype:'{0}',", _dataType.ToString().ToLower()));

Edit option in the grid

Edit option only opens the grid in editable format. Is there any way to save the edited changes back into database? as in any function you forgot to mention in the demo??

say something

I hope the author can continue to update this good libraries, one from the Chinese developers

Local data

Add ability to easily use local data instead of requesting data from the server.

formatoptions .ToLower() should be removed.

Column.cs line 330, in the ToString() method, the ToLower on the format options is causing the baseLinkUrl not to work. it should be removed:

formatoptions: {" + _formatter.Value.Value + "}

aside from a few issues getting this up and running, (due to me missing js ref's or having them out of order, or not knowing i explicitly had to call .SetSortable, and these 2 bugs) this is a really awesome helper, and just what i was looking for! I will definately be using this wherever jqgrid is needed. Thanks!

Split js and html code rendering.

This is a feature request. Is it possible to split js code and html elements rendering?
It can be useful when jquery library is referenced after the page contents.
Now the helper produces the jQuery.ready handler with html table definition and jQuery library is not yet referenced.

extra comma at end of column list

line 1370 in grid.cs is appending an extra comma at teh end of the rendering. this is causing me js errors:
script.AppendLine("],");

userDataOnFooter propery missing

Using classic jqGrid, one must set two things on page:

  1. footerrow : true
  2. userDataOnFooter : true

, after that it is enough to fill ‘userdata’ variable on server side and return json.

Using MvcJqGrid there is only one property: 'SetFooterRow' which refers to 'footerrow' property, but 'userDataOnFooter' is missing so there is no way to populate 'userdata' on server side.

Vinko

jQuery and jqGrid dep. in nuspec?

It would be nice if the MvcJqGrid NuGet package also could install their dependencies: jQuery and jqGrid. Is there a reason why there is no dependency specified in nuget/Package/MvcJqGrid.nuspec?

If you are interested in adding the dependencies I can try to make a Pull Request.

buttonize

Is it possible to get the value of the first cell in the edit row instead of the rowid? Also, can you change the button after it's clicked (from Edit to Save)?

IsSearch not being set.

When changing PageSize with default search values, it does not set the IsSearch flag so using the IsSearch flag to set search values is being bypassed. There can be a work around in the backend code to check to see if PageSize has been set different than default, but currently it is not setting this.Once I finish with my project, I can look into this and possibly submit a fix if no one has got to this by time I do.

localize clear button

.SetSearchClearButton(true)

the text of this button does not change with different locations

Why this values are always false ? : jQuery('#grid').jqGrid('navGrid',"#pager",{edit:false,add:false,del:false,search:false,refresh:false});

Always MvcJqGrid render the script when .SetSearchToolbar(true) :

jQuery('#grid').jqGrid('navGrid',"#pager",{edit:false,add:false,del:false,search:false,refresh:false});

But I want the property search: true and make available both Search Options, the Search ToolBar and the search button on NavGrid

On your code :

if (_searchToolbar == true && !_pager.IsNullOrWhiteSpace() &&
(_searchClearButton.HasValue && _searchClearButton == true || _searchToggleButton.HasValue && _searchToggleButton == true))
{
script.AppendLine("jQuery('#" + _id + "').jqGrid('navGrid',"#" + _pager +
"",{edit:false,add:false,del:false,search:false,refresh:false}); ");
}

Maybe you can add some properties for make dynamic this options

Keep selected state checkboxes after postback

Hi Robin,

I began to use your very helpful MvcJqGrid and I wonder about how can we automatically re-checked all checkbox user has already checked before the post back ?

I retain the information into a database table to know which clients the user checked.

Best regards,
David Létourneau

Rearanging columns by drag and drop

In jqGrid there is an option "sortable" for enabling sorting/rearanging of columns by drag and drop. It would be great, if this option will be supported by MvcJqGrid too.

Regards
Jörg

Question about nav-button

Hi, just wondering is there any support for nav-button?
If not, could you direct me on how to modify the jqgrid generated by the library to add nav-button (In my case, I need an "add row" facilities)

Thanks!

Refresh or Flush the grid

Hello! I am having some kind of weird caching issue with the grid, where even though I am verifying the data coming back from the server, the grid still displays the previous data. Even if a status changes and the line item shows up in the new correct status, it still displays the cached data. On my html layout, I am using these meta tags in the header


But that doesn't seem to help the caching within the grid. Is there some way to flush the data in the grid before retrieving data from the server?

update NuGet package

I've seen that in the current release on NuGet (1.0.9, published 9/16/2012), the recent changes are not yet included (e.g. treeGrid support).
Could you please update the NuGet package?

Thanks in advance

Search problem...

Hi Robin
thank you for publishing awesome mvcjqgrid helper...
I have some problems with search terms in version 1.0.9 :(
search toolbar works great in English language but cannot send true characters to controller in some cultures such as middle east Arabian Culture or Persian...
View is sending '?' character instead of imported characters in above cultures to controller and perhaps cannot return any records as search result!!!
how can I solve this problem!?!?!!?

How can I rebind (refresh) the grid by change method from a DropDownList?

How can I rebind (refresh) the grid by change method from a DropDownList?

I don't see a reloadGrid div for accesing it via jQuery or something like that, like the implementation in jqgrid original. Now I need to refresh the grid while changing a DropDownList with his ID to pass it to the controller.

Somebody?

EditOptions DataEvents for change list with Inline Editing

I have a row-level dropdownlist for inline editing and need to call 'change' event on list value change to make a ajax call to save the new selected value. I am not sure how to write them. Current code for the column is:

.AddColumn(new Column("Mycolumn")
.SetWidth(60)
.SetEditable(true)
.SetEditType(EditType.Select)
.SetEditOptions(new EditOptions() {
Value = "0:Read;1:Review",
DataEvents = @"{
type: 'change',
fn: function (e) {
alert('I changed');
}
}"
})))

Allow multiple search options per Column

Thanks for the good work on this project.
I would really like to see a feature that allows multiple search options to be set, per column.
Would like to know if you are currently working on this, if not at the moment, I would be happy to fork and contribute.

Thanks!

cannot load data with https

Hye, i have an issue.. with development environment. The code to view jgGrid work. but after publish it and i enable https on the IIS setting..the data is not loaded.

How to fix this..Thanks..

i have found the solution...Sorry guys..Just to remind me my self..
Dont Hard code "Coding" ..lol

use this :
.SetUrl(@Url.Action("GridDataBasic", "JSon"))

instead of
.SetUrl("/Json/GridDataBasic")

i18n characters

Filtering with non standard characters makes complete GridSettings.Where equals to null.

Solution:

in public static Filter Create(string jsonData) change the method of generating bytes to MemoryStream from the used method to

var ms = new System.IO.MemoryStream(Encoding.Convert(Encoding.Default, Encoding.UTF8, Encoding.Default.GetBytes(jsonData)));

Regarding selecting "less than" or "equal to" or "greater than" for filter options.

Hi,

The control is perfect. I have one question, I have a date column where I am trying to filter the data on the grid and would like to set the different search type options on that column filter. Is it possible to do ? if so how ?

Here is the code snippet I am using for less than option, but would like to see if it is possible to select the type of search as well like "less than" or "equal" or "greater than".

.AddColumn(new Column("RequiredDate").SetFormatter(Formatters.Date).SetSearchType(Searchtype.Datepicker).
SetSearchDateFormat("dd-mm-yy").SetSearchOption(SearchOptions.Less))

Please help.

Thanks & Regards,
Sam

Add SetSortable method to Grid

Can you add the grid option "sortable"? JqGrid does have a sortable option in the table other than the columns to drag and drop columns themselves in different order

TreeGrid working for JSON?

In the description for the TreeGrid example, it says it has support for auto-detecting the data type. I notice that the example code only uses XML. Has this been tested for JSON? I can't seem to get it to work.

Details:
View Code
@(Html.Grid("totals")
.AddColumn(new Column("Id").SetKey(true).SetHidden(true))
.AddColumn(new Column("Name").SetLabel(" ").SetAsExpandable())
.AddColumn(new Column("Totals").SetLabel("Total Approaches"))

    .SetUrl(@Url.Action("TotalsGridData"))             
    .SetAutoWidth(true)    
    .OnBeforeRequest("onGridBeforeRequest()")
    .OnLoadComplete("onGridLoadComplete(xhr)")
    .OnLoadError("onGridLoadError(xhr, status, error)")
    .EnableTreeGrid(MvcJqGrid.Enums.TreeGridModel.Adjacency)
    .SetDataType(MvcJqGrid.Enums.DataType.Json))

JSON data from the Controller:
{
"total":1,
"page":1,
"records":5,
"rows":
[
{"Id":"1","cell":["TopLevel1","5","0","","false","false","true"]},
{"Id":"2","cell":["TopLevel2","2","0","","false","false","true"]},
{"Id":"3","cell":["TopLevel3","1","0","","false","false","true"]},
{"Id":"4","cell":["TopLevel4","1","0","","false","false","true"]},
{"Id":"5","cell":["TopLevel5","1","0","","false","false","true"]}
]
}

For the OnGridLoadError event handler:
status='parsererror'

error.message=
"Invalid XML..."

Maybe I am just building my JSON object incorrectly, but some additional documentation would be nice. For instance, what order does the metadata in the cell array need to be? I have assumed:

column values to correspond with the columns set on the view followed by...
Level
ParentId
IsLeaf
IsExpanded
??? the last one in your XML example is always 'true' so not sure what it is.

Clear search and Toggle search buttons don't work at all and throw exception

Enable those buttons and press them. Console shows: "ReferenceError: mygrid is not defined"
And indeed, generated code is

jQuery('#courses').jqGrid('navButtonAdd',"#pager",{caption:"Toggle Search",title:"Toggle Search",buttonicon :'ui-icon-refresh', onClickButton:function(){mygrid[0].toggleToolbar(); }});

where mygrid is not defined.

Restore GridSettings

There should be some method to restore GridSettings from some storage. For example, when i store GridSettings in session or other storage, i need a easy way to pass it to grid. Like:

@(Html.Grid("usersGrid").SetGridSettings(...)

Treegrid and json

Hello!

I work width the latest version of jqGrid and latest version of MVCJQgrid.

When enabling Treegrid then it not diplaying json data, but displaying xml-s.
In the generated javascript code we founf "treedatatype = json". This is incorrect
in latest jqgrid. When change to "datatype = json" is correct the problem.

we defining OnBeforeRequest event, and in event setting correct datatype.
This is working.

Best regards

Szabó György

Make column editable

Please add support for editing.

Currently there is no way to add 'editable = true' and 'editrules' and 'editoptions' are missing too...

Search with Dynamic Linq

If it possible and good approach, filtering could be resolved with Dynamic Linq like:
http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx
in my example i filter all fields with Contaions a text, but it could be different for other operators

foreach (var rule in settings.Where.rules)
                {
                    string stingValue;
                    string filter = rule.data.ToLower();
                    data = data.Where(string.Format("{0}.ToString().Contains(@0)",rule.field) ,filter);
                }

Export to CSV

How difficult would it be to add something that would make an ajax call with the search parameters to allow us to get the data that is currently displayed and export it to a CSV?

Basically offering a button on the grid itself that can gather any of the search criteria to allow us to make a call grab data and build a csv file available for download to the user.

So more or less just an ajax call that is akin to the SetUrl call that is tied to a button in the grid? Is there a way I can add something like this myself in JavaScript and grab the grid's search parameters.

Editoptions maxlength not correctly rendered

I'm trying to use EditOptions to add a maxlength attribute to an input type="text" with the following code:

.AddColumn(new Column("Ordenacao")
.SetLabel("Ordem")
.SetSortable(true)
.SetEditOptions(new EditOptions() { OtherOptions = "maxlength: 5"})
.SetWidth(30)
.SetEditable(true))

However, this is rendered like this:

Is this a bug or a mistake in my code?

Set search options for columns

I can't find a way to set search options for a column? It seem they are set by default and there's no way I can change it.

I am talking about this:
{ name: "outputid", index: "outputid", width: 30, searchoptions: { sopt: ['eq', 'cn']} }

When doing this:
.AddColumn(new Column("promoDate").SetAlign(MvcJqGrid.Enums.Align.Center).SetLabel("Fecha Ingreso").SetSearchType(Searchtype.Datepicker).SetSearchDateFormat("yy-mm-dd"))
I receive a bw as rule op, not eq as I would like to set.

Thanks!

_search=false being set on text boxes and datepicker

Not sure why it works on Searchtype.Select, but I found this issue on stackoverflow

http://stackoverflow.com/questions/6442004/jqgrid-search-parameter-not-being-set-in-url

in the MvcJqGrid.Grid.cs class on line 1345, postDate._search = true; is seemingly being passed in.

According to that stackoverflow article, search should not be set on the postData, but instead passed into the grid parameters. I myself am not sure how I can set this, but if you could provide me some guidance or issue a fix, that would be great!

Thanks!

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.