mateuszmarkowski / jQuery-Seat-Charts

jQuery Seat Charts Plugin
MIT License
596 stars 209 forks source link

Skip Seat Numbers for each underscore character #74

Open miljosh68 opened 6 years ago

miljosh68 commented 6 years ago

I am not sure if there is a setting to accomplish what I wish to do. I understand that, whenever there is a (_) underscore character, it is an empty place. I wish that the code should skip the seat number when it comes across underscore character. The problem is that it keeps numbering seats in a continuous manner.

Please refer to the below screenshot. Consider that there is a gap in the center of the hall. Let us consider row 'A'. After seat number A10, I would expect the next seat number to be 'A11' but it shows 'A14' (since the gap is 3 seats wide). Is there a way to make the code skip seat numbering for each '_' character?

image

jctmf commented 6 years ago

Have this problem too.

mateuszmarkowski commented 6 years ago

Please see a similar issue https://github.com/mateuszmarkowski/jQuery-Seat-Charts/issues/62.

You can specify your own function generating labels which will skip empty places: https://github.com/mateuszmarkowski/jQuery-Seat-Charts#naming

ilrisa commented 5 years ago

hi, I agree with the request made by Jaycer17, can i have an example of how to set the functions GetLabel and GetId? Thank you

spinninghamster commented 5 years ago

I am also looking for a solution. Can't figure it out :(

mateuszmarkowski commented 5 years ago

The issue is that JSC doesn't analyze columns to check if they are empty and therefore it automatically assigns a subsequent number to each of the columns assuming they have at least one non empty seat.

The following jsfiddle demonstrates how to "skip" empty columns (naming.columns attribute is the key, the rest is just the demo map): https://jsfiddle.net/50c8hf32/

naming : {
  getLabel : function (character, row, column) {
    return row+column;
  },
  rows: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'],
  columns : ['1', '2', '', '3', '4']
}