Skip to content

Commit f48b53a

Browse files
committed
Added support for custom config object
1 parent 3dc0042 commit f48b53a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

jqgrid.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2727
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2828
# POSSIBILITY OF SUCH DAMAGE.
29-
#
29+
3030
import operator
3131
from django.db import models
3232
from django.core.exceptions import FieldError, ImproperlyConfigured
@@ -42,6 +42,7 @@ class JqGrid(object):
4242
model = None
4343
fields = []
4444
allow_empty = True
45+
extra_config = {}
4546

4647
pager_id = '#pager'
4748
url = None
@@ -229,6 +230,7 @@ def get_caption(self):
229230

230231
def get_config(self, as_json=True):
231232
config = self.get_default_config()
233+
config.update(self.extra_config)
232234
config.update({
233235
'url': self.get_url(),
234236
'caption': self.get_caption(),
@@ -237,7 +239,7 @@ def get_config(self, as_json=True):
237239
if as_json:
238240
config = json_encode(config)
239241
return config
240-
242+
241243
def lookup_foreign_key_field(self, options, field_name):
242244
'''Make a field lookup converting __ into real models fields'''
243245
if '__' in field_name:

0 commit comments

Comments
 (0)