Comments (4)
I've written an example to show the current behaviour.
Uncomment the additional script tags to try out my fix.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Example for testing the cell rendering after editing.</title>
<meta charset="utf-8" />
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="http://code.gijgo.com/1.0.0/js/gijgo.js" type="text/javascript"></script>
<!--
<script src="http://rawgit.com/mvdputten/gijgo/bugfixrenderafteredit/src/widget.js" type="text/javascript"></script>
<script src="http://rawgit.com/mvdputten/gijgo/bugfixrenderafteredit/src/grid/js/grid.base.config.js" type="text/javascript"></script>
<script src="http://rawgit.com/mvdputten/gijgo/bugfixrenderafteredit/src/grid/js/grid.base.events.js" type="text/javascript"></script>
<script src="http://rawgit.com/mvdputten/gijgo/bugfixrenderafteredit/src/grid/js/grid.base.methods.js" type="text/javascript"></script>
<script src="http://rawgit.com/mvdputten/gijgo/bugfixrenderafteredit/src/grid/js/grid.base.widget.js" type="text/javascript"></script>
<script src="http://rawgit.com/mvdputten/gijgo/bugfixrenderafteredit/src/grid/js/grid.inlineEditing.js" type="text/javascript"></script>
-->
<link href="http://code.gijgo.com/1.0.0/css/gijgo.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table id="grid" style="width:100%"/>
<script type="text/javascript">
var weekdays = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
$(document).ready(function () {
var data, textEditor, weekDayEditor, weekDayRenderer;
data = [
{ "ID": 1, "Name": "Hristo Stoichkov", "DayOfWeek": 1 },
{ "ID": 2, "Name": "Ronaldo Luís Nazário de Lima", "DayOfWeek": 3 },
{ "ID": 3, "Name": "David Platt", "DayOfWeek": 4 }
];
textEditor = function($container, currentValue) {
$container.append('<input type="text" value="' + currentValue.replace(/\'(.*)\'/, '$1') + '" style="width:95%"/>');
},
weekDayRenderer = function (value, record, $cell, $displayEl) {
$displayEl.text(weekdays[value]);
};
weekDayEditor = function ($container, currentValue) {
var selectHtml, selected;
selectHtml = "<select>";
weekdays.forEach(function (label, value) {
selected = (currentValue !== undefined && value === currentValue)?"SELECTED":"";
selectHtml += "<option " + selected + " value=" + value + ">" + label + "</option>"
});
selectHtml += "</select>";
$container.append(selectHtml);
};
$("#grid").grid({
dataSource: data,
columns: [
{ field: "ID", width: 34 },
{ field: "Name", tmpl: "'{Name}'", title: "Template: '{Name}'", editor: textEditor },
{ field: "DayOfWeek", title: "Renderer: Day of week", renderer:weekDayRenderer, editor: weekDayEditor },
]
});
});
</script>
</body>
</html>
from gijgo.
Thanks for finding this issue. We are going to fix this problem in the new release, that is planned for release later this year.
from gijgo.
This issue is fixed in the new development version 1.1.0. You can see an working example at http://localhost:59034/Temp/2dc31c65-e4e7-44b6-8bae-36b5feff16de.html
You can use the current development version from:
https://cdn.rawgit.com/atatanasov/gijgo/master/dist/combined/js/gijgo.min.js
https://cdn.rawgit.com/atatanasov/gijgo/master/dist/combined/css/gijgo.min.css
from gijgo.
Works like a charm. Thanks!
from gijgo.
Related Issues (20)
- Bootstrap 5 HOT 3
- Unable to integrate with MVC HOT 1
- Call an asynchronous function from the disableDates property of datepicker
- Treeview check and Uncheck Issue
- How to know checkbox selected or unselected event? HOT 1
- grid - conditional tmpl rendering
- Issue regarding time picker HOT 1
- gijgo is automatically rendering inputs
- Not able to install using Bower
- Bootstrap5 HOT 2
- Question: Usage without JQuery HOT 1
- Grid Dropdown in Edit Mode HOT 1
- Give the input placeholder option & Also make a default date value for the input. HOT 1
- Question: Do you have something like getNodeByPath on the tree? HOT 1
- You can use (-) to get indefinite checkboxes
- Tree Issues: What am I missing? HOT 6
- getCheckedNodes is not a function if tree is in a modal HOT 1
- Question: Changing an array dataSource at runtime & refresh the tree.
- Add enable and disable methods for datepicker and timepicker
- Add creatable option for dropdown like react-select
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gijgo.